# 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 ItemDetails(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 = {
        'purchase_order_number': 'str',
        'lot_number': 'str',
        'expiry': 'Expiry',
        'maximum_retail_price': 'Money',
        'handling_code': 'str',
    }

    attribute_map = {
        'purchase_order_number': 'purchaseOrderNumber',
        'lot_number': 'lotNumber',
        'expiry': 'expiry',
        'maximum_retail_price': 'maximumRetailPrice',
        'handling_code': 'handlingCode',
    }

    def __init__(self, purchase_order_number=None, lot_number=None, expiry=None, maximum_retail_price=None, handling_code=None, _configuration=None):  # noqa: E501
        """ItemDetails - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._purchase_order_number = None
        self._lot_number = None
        self._expiry = None
        self._maximum_retail_price = None
        self._handling_code = None
        self.discriminator = None

        if purchase_order_number is not None:
            self.purchase_order_number = purchase_order_number
        if lot_number is not None:
            self.lot_number = lot_number
        if expiry is not None:
            self.expiry = expiry
        if maximum_retail_price is not None:
            self.maximum_retail_price = maximum_retail_price
        if handling_code is not None:
            self.handling_code = handling_code

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

        The purchase order number for the shipment being confirmed. If the items in this shipment belong to multiple purchase order numbers that are in particular carton or pallet within the shipment, then provide the purchaseOrderNumber at the appropriate carton or pallet level. Formatting Notes: 8-character alpha-numeric code.  # noqa: E501

        :return: The purchase_order_number of this ItemDetails.  # noqa: E501
        :rtype: str
        """
        return self._purchase_order_number

    @purchase_order_number.setter
    def purchase_order_number(self, purchase_order_number):
        """Sets the purchase_order_number of this ItemDetails.

        The purchase order number for the shipment being confirmed. If the items in this shipment belong to multiple purchase order numbers that are in particular carton or pallet within the shipment, then provide the purchaseOrderNumber at the appropriate carton or pallet level. Formatting Notes: 8-character alpha-numeric code.  # noqa: E501

        :param purchase_order_number: The purchase_order_number of this ItemDetails.  # noqa: E501
        :type: str
        """

        self._purchase_order_number = purchase_order_number

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

        The batch or lot number associates an item with information the manufacturer considers relevant for traceability of the trade item to which the Element String is applied. The data may refer to the trade item itself or to items contained. This field is mandatory for all perishable items.  # noqa: E501

        :return: The lot_number of this ItemDetails.  # noqa: E501
        :rtype: str
        """
        return self._lot_number

    @lot_number.setter
    def lot_number(self, lot_number):
        """Sets the lot_number of this ItemDetails.

        The batch or lot number associates an item with information the manufacturer considers relevant for traceability of the trade item to which the Element String is applied. The data may refer to the trade item itself or to items contained. This field is mandatory for all perishable items.  # noqa: E501

        :param lot_number: The lot_number of this ItemDetails.  # noqa: E501
        :type: str
        """

        self._lot_number = lot_number

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


        :return: The expiry of this ItemDetails.  # noqa: E501
        :rtype: Expiry
        """
        return self._expiry

    @expiry.setter
    def expiry(self, expiry):
        """Sets the expiry of this ItemDetails.


        :param expiry: The expiry of this ItemDetails.  # noqa: E501
        :type: Expiry
        """

        self._expiry = expiry

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


        :return: The maximum_retail_price of this ItemDetails.  # noqa: E501
        :rtype: Money
        """
        return self._maximum_retail_price

    @maximum_retail_price.setter
    def maximum_retail_price(self, maximum_retail_price):
        """Sets the maximum_retail_price of this ItemDetails.


        :param maximum_retail_price: The maximum_retail_price of this ItemDetails.  # noqa: E501
        :type: Money
        """

        self._maximum_retail_price = maximum_retail_price

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

        Identification of the instructions on how specified item/carton/pallet should be handled.  # noqa: E501

        :return: The handling_code of this ItemDetails.  # noqa: E501
        :rtype: str
        """
        return self._handling_code

    @handling_code.setter
    def handling_code(self, handling_code):
        """Sets the handling_code of this ItemDetails.

        Identification of the instructions on how specified item/carton/pallet should be handled.  # noqa: E501

        :param handling_code: The handling_code of this ItemDetails.  # noqa: E501
        :type: str
        """
        allowed_values = ["Oversized", "Fragile", "Food", "HandleWithCare"]  # noqa: E501
        if (self._configuration.client_side_validation and
                handling_code not in allowed_values):
            raise ValueError(
                "Invalid value for `handling_code` ({0}), must be one of {1}"  # noqa: E501
                .format(handling_code, allowed_values)
            )

        self._handling_code = handling_code

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

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