# coding: utf-8

"""
    Selling Partner API for Retail Procurement Shipments

    The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.

    The version of the OpenAPI document: v1
    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 ContainerItem(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 = {
        'item_reference': 'str',
        'shipped_quantity': 'ItemQuantity',
        'item_details': 'ItemDetails',
    }

    attribute_map = {
        'item_reference': 'itemReference',
        'shipped_quantity': 'shippedQuantity',
        'item_details': 'itemDetails',
    }

    def __init__(self, item_reference=None, shipped_quantity=None, item_details=None, _configuration=None):  # noqa: E501
        """ContainerItem - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._item_reference = None
        self._shipped_quantity = None
        self._item_details = None
        self.discriminator = None

        self.item_reference = item_reference
        self.shipped_quantity = shipped_quantity
        if item_details is not None:
            self.item_details = item_details

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

        The reference number for the item. Please provide the itemSequenceNumber from the 'items' segment to refer to that item's details here.  # noqa: E501

        :return: The item_reference of this ContainerItem.  # noqa: E501
        :rtype: str
        """
        return self._item_reference

    @item_reference.setter
    def item_reference(self, item_reference):
        """Sets the item_reference of this ContainerItem.

        The reference number for the item. Please provide the itemSequenceNumber from the 'items' segment to refer to that item's details here.  # noqa: E501

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

        self._item_reference = item_reference

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


        :return: The shipped_quantity of this ContainerItem.  # noqa: E501
        :rtype: ItemQuantity
        """
        return self._shipped_quantity

    @shipped_quantity.setter
    def shipped_quantity(self, shipped_quantity):
        """Sets the shipped_quantity of this ContainerItem.


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

        self._shipped_quantity = shipped_quantity

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


        :return: The item_details of this ContainerItem.  # noqa: E501
        :rtype: ItemDetails
        """
        return self._item_details

    @item_details.setter
    def item_details(self, item_details):
        """Sets the item_details of this ContainerItem.


        :param item_details: The item_details of this ContainerItem.  # noqa: E501
        :type: ItemDetails
        """

        self._item_details = item_details

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

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