# coding: utf-8

"""
    The Selling Partner API for Amazon External Fulfillment Shipments Processing

    You can use the External Fulfillment Shipments API to retrieve, manage, and track shipments processed through Amazon's external fulfillment network. Use this API to get shipment details, monitor status changes, and access fulfillment requirements.

    The version of the OpenAPI document: 2024-09-11
    Contact: marketplaceapitest@amazon.com
    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 PackageLineItem(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 = {
        'package_line_item_id': 'str',
        'quantity': 'int',
        'serial_numbers': 'List[str]',
        'pieces': 'int',
        'country_of_origin': 'str',
        'item_value': 'Amount',
    }

    attribute_map = {
        'package_line_item_id': 'packageLineItemId',
        'quantity': 'quantity',
        'serial_numbers': 'serialNumbers',
        'pieces': 'pieces',
        'country_of_origin': 'countryOfOrigin',
        'item_value': 'itemValue',
    }

    def __init__(self, package_line_item_id=None, quantity=None, serial_numbers=None, pieces=None, country_of_origin=None, item_value=None, _configuration=None):  # noqa: E501
        """PackageLineItem - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._package_line_item_id = None
        self._quantity = None
        self._serial_numbers = None
        self._pieces = None
        self._country_of_origin = None
        self._item_value = None
        self.discriminator = None

        self.package_line_item_id = package_line_item_id
        self.quantity = quantity
        if serial_numbers is not None:
            self.serial_numbers = serial_numbers
        if pieces is not None:
            self.pieces = pieces
        if country_of_origin is not None:
            self.country_of_origin = country_of_origin
        if item_value is not None:
            self.item_value = item_value

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

        The line item ID.  # noqa: E501

        :return: The package_line_item_id of this PackageLineItem.  # noqa: E501
        :rtype: str
        """
        return self._package_line_item_id

    @package_line_item_id.setter
    def package_line_item_id(self, package_line_item_id):
        """Sets the package_line_item_id of this PackageLineItem.

        The line item ID.  # noqa: E501

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

        self._package_line_item_id = package_line_item_id

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

        The number of items of a particular line item of a shipment that are packed into the package.  # noqa: E501

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

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

        The number of items of a particular line item of a shipment that are packed into the package.  # noqa: E501

        :param quantity: The quantity of this PackageLineItem.  # 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

        self._quantity = quantity

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

        The list of serial numbers of items in the package, if required to be provided.  # noqa: E501

        :return: The serial_numbers of this PackageLineItem.  # noqa: E501
        :rtype: List[str]
        """
        return self._serial_numbers

    @serial_numbers.setter
    def serial_numbers(self, serial_numbers):
        """Sets the serial_numbers of this PackageLineItem.

        The list of serial numbers of items in the package, if required to be provided.  # noqa: E501

        :param serial_numbers: The serial_numbers of this PackageLineItem.  # noqa: E501
        :type: List[str]
        """
        if (self._configuration.client_side_validation and
                serial_numbers is not None and len(serial_numbers) < 0):
            raise ValueError("Invalid value for `serial_numbers`, number of items must be greater than or equal to `0`")  # noqa: E501

        self._serial_numbers = serial_numbers

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

        The number of pieces of a multi-piece item that are in this package. This is applicable only for items that are shipped in multiple pieces.  # noqa: E501

        :return: The pieces of this PackageLineItem.  # noqa: E501
        :rtype: int
        """
        return self._pieces

    @pieces.setter
    def pieces(self, pieces):
        """Sets the pieces of this PackageLineItem.

        The number of pieces of a multi-piece item that are in this package. This is applicable only for items that are shipped in multiple pieces.  # noqa: E501

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

        self._pieces = pieces

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

        A two-letter country code, as defined by the ISO-3166 alpha-2 standard.  # noqa: E501

        :return: The country_of_origin of this PackageLineItem.  # noqa: E501
        :rtype: str
        """
        return self._country_of_origin

    @country_of_origin.setter
    def country_of_origin(self, country_of_origin):
        """Sets the country_of_origin of this PackageLineItem.

        A two-letter country code, as defined by the ISO-3166 alpha-2 standard.  # noqa: E501

        :param country_of_origin: The country_of_origin of this PackageLineItem.  # noqa: E501
        :type: str
        """

        self._country_of_origin = country_of_origin

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


        :return: The item_value of this PackageLineItem.  # noqa: E501
        :rtype: Amount
        """
        return self._item_value

    @item_value.setter
    def item_value(self, item_value):
        """Sets the item_value of this PackageLineItem.


        :param item_value: The item_value of this PackageLineItem.  # noqa: E501
        :type: Amount
        """

        self._item_value = item_value

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

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