# 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 ItemRelationship(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 = {
        'child_skus': 'List[str]',
        'parent_skus': 'List[str]',
        'variation_theme': 'ItemVariationTheme',
        'type': 'str',
    }

    attribute_map = {
        'child_skus': 'childSkus',
        'parent_skus': 'parentSkus',
        'variation_theme': 'variationTheme',
        'type': 'type',
    }

    def __init__(self, child_skus=None, parent_skus=None, variation_theme=None, type=None, _configuration=None):  # noqa: E501
        """ItemRelationship - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._child_skus = None
        self._parent_skus = None
        self._variation_theme = None
        self._type = None
        self.discriminator = None

        if child_skus is not None:
            self.child_skus = child_skus
        if parent_skus is not None:
            self.parent_skus = parent_skus
        if variation_theme is not None:
            self.variation_theme = variation_theme
        self.type = type

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

        Identifiers (SKUs) of the related items that are children of this listing item.  # noqa: E501

        :return: The child_skus of this ItemRelationship.  # noqa: E501
        :rtype: List[str]
        """
        return self._child_skus

    @child_skus.setter
    def child_skus(self, child_skus):
        """Sets the child_skus of this ItemRelationship.

        Identifiers (SKUs) of the related items that are children of this listing item.  # noqa: E501

        :param child_skus: The child_skus of this ItemRelationship.  # noqa: E501
        :type: List[str]
        """

        self._child_skus = child_skus

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

        Identifiers (SKUs) of the related items that are parents of this listing item.  # noqa: E501

        :return: The parent_skus of this ItemRelationship.  # noqa: E501
        :rtype: List[str]
        """
        return self._parent_skus

    @parent_skus.setter
    def parent_skus(self, parent_skus):
        """Sets the parent_skus of this ItemRelationship.

        Identifiers (SKUs) of the related items that are parents of this listing item.  # noqa: E501

        :param parent_skus: The parent_skus of this ItemRelationship.  # noqa: E501
        :type: List[str]
        """

        self._parent_skus = parent_skus

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


        :return: The variation_theme of this ItemRelationship.  # noqa: E501
        :rtype: ItemVariationTheme
        """
        return self._variation_theme

    @variation_theme.setter
    def variation_theme(self, variation_theme):
        """Sets the variation_theme of this ItemRelationship.


        :param variation_theme: The variation_theme of this ItemRelationship.  # noqa: E501
        :type: ItemVariationTheme
        """

        self._variation_theme = variation_theme

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

        The type of relationship.  # noqa: E501

        :return: The type of this ItemRelationship.  # noqa: E501
        :rtype: str
        """
        return self._type

    @type.setter
    def type(self, type):
        """Sets the type of this ItemRelationship.

        The type of relationship.  # noqa: E501

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

        self._type = type

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

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