# 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 ShipmentLineItem(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 = {
        'shipment_line_item_id': 'str',
        'merchant_sku': 'str',
        'number_of_units': 'int',
        'serial_numbers': 'List[str]',
        'piece_type': 'PieceType',
        'hazmat_labels': 'List[str]',
        'gift_attributes': 'GiftAttributes',
        'charges': 'List[Charge]',
        'cancellations': 'List[Cancellation]',
        'hsn_code': 'str',
        'recommended_country_of_origin': 'str',
        'country_of_origin': 'str',
        'recommended_currency_code': 'str',
        'item_value': 'Amount',
        'compliance_attributes': 'ComplianceAttributes',
        'custom_attributes': 'List[CustomAttribute]',
    }

    attribute_map = {
        'shipment_line_item_id': 'shipmentLineItemId',
        'merchant_sku': 'merchantSku',
        'number_of_units': 'numberOfUnits',
        'serial_numbers': 'serialNumbers',
        'piece_type': 'pieceType',
        'hazmat_labels': 'hazmatLabels',
        'gift_attributes': 'giftAttributes',
        'charges': 'charges',
        'cancellations': 'cancellations',
        'hsn_code': 'hsnCode',
        'recommended_country_of_origin': 'recommendedCountryOfOrigin',
        'country_of_origin': 'countryOfOrigin',
        'recommended_currency_code': 'recommendedCurrencyCode',
        'item_value': 'itemValue',
        'compliance_attributes': 'complianceAttributes',
        'custom_attributes': 'customAttributes',
    }

    def __init__(self, shipment_line_item_id=None, merchant_sku=None, number_of_units=None, serial_numbers=None, piece_type=None, hazmat_labels=None, gift_attributes=None, charges=None, cancellations=None, hsn_code=None, recommended_country_of_origin=None, country_of_origin=None, recommended_currency_code=None, item_value=None, compliance_attributes=None, custom_attributes=None, _configuration=None):  # noqa: E501
        """ShipmentLineItem - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._shipment_line_item_id = None
        self._merchant_sku = None
        self._number_of_units = None
        self._serial_numbers = None
        self._piece_type = None
        self._hazmat_labels = None
        self._gift_attributes = None
        self._charges = None
        self._cancellations = None
        self._hsn_code = None
        self._recommended_country_of_origin = None
        self._country_of_origin = None
        self._recommended_currency_code = None
        self._item_value = None
        self._compliance_attributes = None
        self._custom_attributes = None
        self.discriminator = None

        self.shipment_line_item_id = shipment_line_item_id
        self.merchant_sku = merchant_sku
        self.number_of_units = number_of_units
        if serial_numbers is not None:
            self.serial_numbers = serial_numbers
        if piece_type is not None:
            self.piece_type = piece_type
        if hazmat_labels is not None:
            self.hazmat_labels = hazmat_labels
        if gift_attributes is not None:
            self.gift_attributes = gift_attributes
        self.charges = charges
        if cancellations is not None:
            self.cancellations = cancellations
        if hsn_code is not None:
            self.hsn_code = hsn_code
        if recommended_country_of_origin is not None:
            self.recommended_country_of_origin = recommended_country_of_origin
        if country_of_origin is not None:
            self.country_of_origin = country_of_origin
        if recommended_currency_code is not None:
            self.recommended_currency_code = recommended_currency_code
        if item_value is not None:
            self.item_value = item_value
        self.compliance_attributes = compliance_attributes
        if custom_attributes is not None:
            self.custom_attributes = custom_attributes

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

        An identifier for a shipment's line item. This identifier is guaranteed to be unique within the scope of its containing shipment.  # noqa: E501

        :return: The shipment_line_item_id of this ShipmentLineItem.  # noqa: E501
        :rtype: str
        """
        return self._shipment_line_item_id

    @shipment_line_item_id.setter
    def shipment_line_item_id(self, shipment_line_item_id):
        """Sets the shipment_line_item_id of this ShipmentLineItem.

        An identifier for a shipment's line item. This identifier is guaranteed to be unique within the scope of its containing shipment.  # noqa: E501

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

        self._shipment_line_item_id = shipment_line_item_id

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

        The seller SKU of a product (catalog item). A unique number assigned by the seller when listing an item.  # noqa: E501

        :return: The merchant_sku of this ShipmentLineItem.  # noqa: E501
        :rtype: str
        """
        return self._merchant_sku

    @merchant_sku.setter
    def merchant_sku(self, merchant_sku):
        """Sets the merchant_sku of this ShipmentLineItem.

        The seller SKU of a product (catalog item). A unique number assigned by the seller when listing an item.  # noqa: E501

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

        self._merchant_sku = merchant_sku

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

        The number of items of the SKU in this line item.  # noqa: E501

        :return: The number_of_units of this ShipmentLineItem.  # noqa: E501
        :rtype: int
        """
        return self._number_of_units

    @number_of_units.setter
    def number_of_units(self, number_of_units):
        """Sets the number_of_units of this ShipmentLineItem.

        The number of items of the SKU in this line item.  # noqa: E501

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

        self._number_of_units = number_of_units

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

        The serial numbers for each item in this line item.  # noqa: E501

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

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

        The serial numbers for each item in this line item.  # noqa: E501

        :param serial_numbers: The serial_numbers of this ShipmentLineItem.  # 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 piece_type(self):
        """Gets the piece_type of this ShipmentLineItem.  # noqa: E501


        :return: The piece_type of this ShipmentLineItem.  # noqa: E501
        :rtype: PieceType
        """
        return self._piece_type

    @piece_type.setter
    def piece_type(self, piece_type):
        """Sets the piece_type of this ShipmentLineItem.


        :param piece_type: The piece_type of this ShipmentLineItem.  # noqa: E501
        :type: PieceType
        """

        self._piece_type = piece_type

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

        A list of HAZMAT label identifiers that must be applied to the packages for this line item.  # noqa: E501

        :return: The hazmat_labels of this ShipmentLineItem.  # noqa: E501
        :rtype: List[str]
        """
        return self._hazmat_labels

    @hazmat_labels.setter
    def hazmat_labels(self, hazmat_labels):
        """Sets the hazmat_labels of this ShipmentLineItem.

        A list of HAZMAT label identifiers that must be applied to the packages for this line item.  # noqa: E501

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

        self._hazmat_labels = hazmat_labels

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


        :return: The gift_attributes of this ShipmentLineItem.  # noqa: E501
        :rtype: GiftAttributes
        """
        return self._gift_attributes

    @gift_attributes.setter
    def gift_attributes(self, gift_attributes):
        """Sets the gift_attributes of this ShipmentLineItem.


        :param gift_attributes: The gift_attributes of this ShipmentLineItem.  # noqa: E501
        :type: GiftAttributes
        """

        self._gift_attributes = gift_attributes

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

        The charges associated with the shipment.  # noqa: E501

        :return: The charges of this ShipmentLineItem.  # noqa: E501
        :rtype: List[Charge]
        """
        return self._charges

    @charges.setter
    def charges(self, charges):
        """Sets the charges of this ShipmentLineItem.

        The charges associated with the shipment.  # noqa: E501

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

        self._charges = charges

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

        A list of cancellations for the given line item.  **Note:** Currently, SmartConnect does not support partial cancellation of a shipment or its line items. This list will contain a single value with all the cancellation details.  # noqa: E501

        :return: The cancellations of this ShipmentLineItem.  # noqa: E501
        :rtype: List[Cancellation]
        """
        return self._cancellations

    @cancellations.setter
    def cancellations(self, cancellations):
        """Sets the cancellations of this ShipmentLineItem.

        A list of cancellations for the given line item.  **Note:** Currently, SmartConnect does not support partial cancellation of a shipment or its line items. This list will contain a single value with all the cancellation details.  # noqa: E501

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

        self._cancellations = cancellations

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

        The HSN code of SKU in this line item.  # noqa: E501

        :return: The hsn_code of this ShipmentLineItem.  # noqa: E501
        :rtype: str
        """
        return self._hsn_code

    @hsn_code.setter
    def hsn_code(self, hsn_code):
        """Sets the hsn_code of this ShipmentLineItem.

        The HSN code of SKU in this line item.  # noqa: E501

        :param hsn_code: The hsn_code of this ShipmentLineItem.  # noqa: E501
        :type: str
        """

        self._hsn_code = hsn_code

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

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

        :return: The recommended_country_of_origin of this ShipmentLineItem.  # noqa: E501
        :rtype: str
        """
        return self._recommended_country_of_origin

    @recommended_country_of_origin.setter
    def recommended_country_of_origin(self, recommended_country_of_origin):
        """Sets the recommended_country_of_origin of this ShipmentLineItem.

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

        :param recommended_country_of_origin: The recommended_country_of_origin of this ShipmentLineItem.  # noqa: E501
        :type: str
        """

        self._recommended_country_of_origin = recommended_country_of_origin

    @property
    def country_of_origin(self):
        """Gets the country_of_origin of this ShipmentLineItem.  # 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 ShipmentLineItem.  # 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 ShipmentLineItem.

        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 ShipmentLineItem.  # noqa: E501
        :type: str
        """

        self._country_of_origin = country_of_origin

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

        The three digit currency code of the currency recommended by the marketplace, in ISO 4217 format.  # noqa: E501

        :return: The recommended_currency_code of this ShipmentLineItem.  # noqa: E501
        :rtype: str
        """
        return self._recommended_currency_code

    @recommended_currency_code.setter
    def recommended_currency_code(self, recommended_currency_code):
        """Sets the recommended_currency_code of this ShipmentLineItem.

        The three digit currency code of the currency recommended by the marketplace, in ISO 4217 format.  # noqa: E501

        :param recommended_currency_code: The recommended_currency_code of this ShipmentLineItem.  # noqa: E501
        :type: str
        """

        self._recommended_currency_code = recommended_currency_code

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


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

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


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

        self._item_value = item_value

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


        :return: The compliance_attributes of this ShipmentLineItem.  # noqa: E501
        :rtype: ComplianceAttributes
        """
        return self._compliance_attributes

    @compliance_attributes.setter
    def compliance_attributes(self, compliance_attributes):
        """Sets the compliance_attributes of this ShipmentLineItem.


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

        self._compliance_attributes = compliance_attributes

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

        A list of custom passthrough attributes. For details on these attributes, reach out to your respective program teams at Amazon.  # noqa: E501

        :return: The custom_attributes of this ShipmentLineItem.  # noqa: E501
        :rtype: List[CustomAttribute]
        """
        return self._custom_attributes

    @custom_attributes.setter
    def custom_attributes(self, custom_attributes):
        """Sets the custom_attributes of this ShipmentLineItem.

        A list of custom passthrough attributes. For details on these attributes, reach out to your respective program teams at Amazon.  # noqa: E501

        :param custom_attributes: The custom_attributes of this ShipmentLineItem.  # noqa: E501
        :type: List[CustomAttribute]
        """

        self._custom_attributes = custom_attributes

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

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