# coding: utf-8

"""
    The Selling Partner API for FBA inbound operations.

    The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.

    The version of the OpenAPI document: 2024-03-20
    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 Item(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 = {
        'asin': 'str',
        'expiration': 'str',
        'fnsku': 'str',
        'label_owner': 'str',
        'manufacturing_lot_code': 'str',
        'msku': 'str',
        'prep_instructions': 'List[PrepInstruction]',
        'quantity': 'int',
    }

    attribute_map = {
        'asin': 'asin',
        'expiration': 'expiration',
        'fnsku': 'fnsku',
        'label_owner': 'labelOwner',
        'manufacturing_lot_code': 'manufacturingLotCode',
        'msku': 'msku',
        'prep_instructions': 'prepInstructions',
        'quantity': 'quantity',
    }

    def __init__(self, asin=None, expiration=None, fnsku=None, label_owner=None, manufacturing_lot_code=None, msku=None, prep_instructions=None, quantity=None, _configuration=None):  # noqa: E501
        """Item - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._asin = None
        self._expiration = None
        self._fnsku = None
        self._label_owner = None
        self._manufacturing_lot_code = None
        self._msku = None
        self._prep_instructions = None
        self._quantity = None
        self.discriminator = None

        self.asin = asin
        if expiration is not None:
            self.expiration = expiration
        self.fnsku = fnsku
        self.label_owner = label_owner
        if manufacturing_lot_code is not None:
            self.manufacturing_lot_code = manufacturing_lot_code
        self.msku = msku
        self.prep_instructions = prep_instructions
        self.quantity = quantity

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

        The Amazon Standard Identification Number (ASIN) of the item.  # noqa: E501

        :return: The asin of this Item.  # noqa: E501
        :rtype: str
        """
        return self._asin

    @asin.setter
    def asin(self, asin):
        """Sets the asin of this Item.

        The Amazon Standard Identification Number (ASIN) of the item.  # noqa: E501

        :param asin: The asin of this Item.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and asin is None:
            raise ValueError("Invalid value for `asin`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                asin is not None and len(asin) > 10):
            raise ValueError("Invalid value for `asin`, length must be less than or equal to `10`")  # noqa: E501
        if (self._configuration.client_side_validation and
                asin is not None and len(asin) < 1):
            raise ValueError("Invalid value for `asin`, length must be greater than or equal to `1`")  # noqa: E501

        self._asin = asin

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

        The expiration date of the MSKU. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern`YYYY-MM-DD`. The same MSKU with different expiration dates cannot go into the same box.  # noqa: E501

        :return: The expiration of this Item.  # noqa: E501
        :rtype: str
        """
        return self._expiration

    @expiration.setter
    def expiration(self, expiration):
        """Sets the expiration of this Item.

        The expiration date of the MSKU. In [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) datetime format with pattern`YYYY-MM-DD`. The same MSKU with different expiration dates cannot go into the same box.  # noqa: E501

        :param expiration: The expiration of this Item.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                expiration is not None and not re.search(r'^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$', expiration)):  # noqa: E501
            raise ValueError(r"Invalid value for `expiration`, must be a follow pattern or equal to `/^([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/`")  # noqa: E501

        self._expiration = expiration

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

        A unique identifier assigned by Amazon to products stored in and fulfilled from an Amazon fulfillment center.  # noqa: E501

        :return: The fnsku of this Item.  # noqa: E501
        :rtype: str
        """
        return self._fnsku

    @fnsku.setter
    def fnsku(self, fnsku):
        """Sets the fnsku of this Item.

        A unique identifier assigned by Amazon to products stored in and fulfilled from an Amazon fulfillment center.  # noqa: E501

        :param fnsku: The fnsku of this Item.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and fnsku is None:
            raise ValueError("Invalid value for `fnsku`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                fnsku is not None and len(fnsku) > 10):
            raise ValueError("Invalid value for `fnsku`, length must be less than or equal to `10`")  # noqa: E501
        if (self._configuration.client_side_validation and
                fnsku is not None and len(fnsku) < 1):
            raise ValueError("Invalid value for `fnsku`, length must be greater than or equal to `1`")  # noqa: E501

        self._fnsku = fnsku

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

        Specifies who will label the items. Options include `AMAZON`, `SELLER`, and `NONE`.  # noqa: E501

        :return: The label_owner of this Item.  # noqa: E501
        :rtype: str
        """
        return self._label_owner

    @label_owner.setter
    def label_owner(self, label_owner):
        """Sets the label_owner of this Item.

        Specifies who will label the items. Options include `AMAZON`, `SELLER`, and `NONE`.  # noqa: E501

        :param label_owner: The label_owner of this Item.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and label_owner is None:
            raise ValueError("Invalid value for `label_owner`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                label_owner is not None and len(label_owner) > 1024):
            raise ValueError("Invalid value for `label_owner`, length must be less than or equal to `1024`")  # noqa: E501
        if (self._configuration.client_side_validation and
                label_owner is not None and len(label_owner) < 1):
            raise ValueError("Invalid value for `label_owner`, length must be greater than or equal to `1`")  # noqa: E501

        self._label_owner = label_owner

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

        The manufacturing lot code.  # noqa: E501

        :return: The manufacturing_lot_code of this Item.  # noqa: E501
        :rtype: str
        """
        return self._manufacturing_lot_code

    @manufacturing_lot_code.setter
    def manufacturing_lot_code(self, manufacturing_lot_code):
        """Sets the manufacturing_lot_code of this Item.

        The manufacturing lot code.  # noqa: E501

        :param manufacturing_lot_code: The manufacturing_lot_code of this Item.  # noqa: E501
        :type: str
        """
        if (self._configuration.client_side_validation and
                manufacturing_lot_code is not None and len(manufacturing_lot_code) > 256):
            raise ValueError("Invalid value for `manufacturing_lot_code`, length must be less than or equal to `256`")  # noqa: E501
        if (self._configuration.client_side_validation and
                manufacturing_lot_code is not None and len(manufacturing_lot_code) < 1):
            raise ValueError("Invalid value for `manufacturing_lot_code`, length must be greater than or equal to `1`")  # noqa: E501

        self._manufacturing_lot_code = manufacturing_lot_code

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

        The merchant-defined SKU ID.  # noqa: E501

        :return: The msku of this Item.  # noqa: E501
        :rtype: str
        """
        return self._msku

    @msku.setter
    def msku(self, msku):
        """Sets the msku of this Item.

        The merchant-defined SKU ID.  # noqa: E501

        :param msku: The msku of this Item.  # noqa: E501
        :type: str
        """
        if self._configuration.client_side_validation and msku is None:
            raise ValueError("Invalid value for `msku`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                msku is not None and len(msku) > 255):
            raise ValueError("Invalid value for `msku`, length must be less than or equal to `255`")  # noqa: E501
        if (self._configuration.client_side_validation and
                msku is not None and len(msku) < 1):
            raise ValueError("Invalid value for `msku`, length must be greater than or equal to `1`")  # noqa: E501

        self._msku = msku

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

        Special preparations that are required for an item.  # noqa: E501

        :return: The prep_instructions of this Item.  # noqa: E501
        :rtype: List[PrepInstruction]
        """
        return self._prep_instructions

    @prep_instructions.setter
    def prep_instructions(self, prep_instructions):
        """Sets the prep_instructions of this Item.

        Special preparations that are required for an item.  # noqa: E501

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

        self._prep_instructions = prep_instructions

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

        The number of the specified MSKU.  # noqa: E501

        :return: The quantity of this Item.  # noqa: E501
        :rtype: int
        """
        return self._quantity

    @quantity.setter
    def quantity(self, quantity):
        """Sets the quantity of this Item.

        The number of the specified MSKU.  # noqa: E501

        :param quantity: The quantity of this Item.  # noqa: E501
        :type: int
        """
        if self._configuration.client_side_validation and quantity is None:
            raise ValueError("Invalid value for `quantity`, must not be `None`")  # noqa: E501
        if (self._configuration.client_side_validation and
                quantity is not None and quantity > 500000):  # noqa: E501
            raise ValueError("Invalid value for `quantity`, must be a value less than or equal to `500000`")  # noqa: E501
        if (self._configuration.client_side_validation and
                quantity is not None and quantity < 1):  # noqa: E501
            raise ValueError("Invalid value for `quantity`, must be a value greater than or equal to `1`")  # noqa: E501

        self._quantity = quantity

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

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