# coding: utf-8

"""
    Selling Partner API for Retail Procurement Payments

    The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.

    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 InvoiceItem(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_sequence_number': 'int',
        'amazon_product_identifier': 'str',
        'vendor_product_identifier': 'str',
        'invoiced_quantity': 'ItemQuantity',
        'net_cost': 'Money',
        'net_cost_unit_of_measure': 'NetCostUnitOfMeasure',
        'purchase_order_number': 'str',
        'hsn_code': 'str',
        'credit_note_details': 'CreditNoteDetails',
        'tax_details': 'List[TaxDetails]',
        'charge_details': 'List[ChargeDetails]',
        'allowance_details': 'List[AllowanceDetails]',
    }

    attribute_map = {
        'item_sequence_number': 'itemSequenceNumber',
        'amazon_product_identifier': 'amazonProductIdentifier',
        'vendor_product_identifier': 'vendorProductIdentifier',
        'invoiced_quantity': 'invoicedQuantity',
        'net_cost': 'netCost',
        'net_cost_unit_of_measure': 'netCostUnitOfMeasure',
        'purchase_order_number': 'purchaseOrderNumber',
        'hsn_code': 'hsnCode',
        'credit_note_details': 'creditNoteDetails',
        'tax_details': 'taxDetails',
        'charge_details': 'chargeDetails',
        'allowance_details': 'allowanceDetails',
    }

    def __init__(self, item_sequence_number=None, amazon_product_identifier=None, vendor_product_identifier=None, invoiced_quantity=None, net_cost=None, net_cost_unit_of_measure=None, purchase_order_number=None, hsn_code=None, credit_note_details=None, tax_details=None, charge_details=None, allowance_details=None, _configuration=None):  # noqa: E501
        """InvoiceItem - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._item_sequence_number = None
        self._amazon_product_identifier = None
        self._vendor_product_identifier = None
        self._invoiced_quantity = None
        self._net_cost = None
        self._net_cost_unit_of_measure = None
        self._purchase_order_number = None
        self._hsn_code = None
        self._credit_note_details = None
        self._tax_details = None
        self._charge_details = None
        self._allowance_details = None
        self.discriminator = None

        self.item_sequence_number = item_sequence_number
        if amazon_product_identifier is not None:
            self.amazon_product_identifier = amazon_product_identifier
        if vendor_product_identifier is not None:
            self.vendor_product_identifier = vendor_product_identifier
        self.invoiced_quantity = invoiced_quantity
        self.net_cost = net_cost
        if net_cost_unit_of_measure is not None:
            self.net_cost_unit_of_measure = net_cost_unit_of_measure
        if purchase_order_number is not None:
            self.purchase_order_number = purchase_order_number
        if hsn_code is not None:
            self.hsn_code = hsn_code
        if credit_note_details is not None:
            self.credit_note_details = credit_note_details
        if tax_details is not None:
            self.tax_details = tax_details
        if charge_details is not None:
            self.charge_details = charge_details
        if allowance_details is not None:
            self.allowance_details = allowance_details

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

        Unique number related to this line item.  # noqa: E501

        :return: The item_sequence_number of this InvoiceItem.  # noqa: E501
        :rtype: int
        """
        return self._item_sequence_number

    @item_sequence_number.setter
    def item_sequence_number(self, item_sequence_number):
        """Sets the item_sequence_number of this InvoiceItem.

        Unique number related to this line item.  # noqa: E501

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

        self._item_sequence_number = item_sequence_number

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

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

        :return: The amazon_product_identifier of this InvoiceItem.  # noqa: E501
        :rtype: str
        """
        return self._amazon_product_identifier

    @amazon_product_identifier.setter
    def amazon_product_identifier(self, amazon_product_identifier):
        """Sets the amazon_product_identifier of this InvoiceItem.

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

        :param amazon_product_identifier: The amazon_product_identifier of this InvoiceItem.  # noqa: E501
        :type: str
        """

        self._amazon_product_identifier = amazon_product_identifier

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

        The vendor selected product identifier of the item. Should be the same as was provided in the purchase order.  # noqa: E501

        :return: The vendor_product_identifier of this InvoiceItem.  # noqa: E501
        :rtype: str
        """
        return self._vendor_product_identifier

    @vendor_product_identifier.setter
    def vendor_product_identifier(self, vendor_product_identifier):
        """Sets the vendor_product_identifier of this InvoiceItem.

        The vendor selected product identifier of the item. Should be the same as was provided in the purchase order.  # noqa: E501

        :param vendor_product_identifier: The vendor_product_identifier of this InvoiceItem.  # noqa: E501
        :type: str
        """

        self._vendor_product_identifier = vendor_product_identifier

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


        :return: The invoiced_quantity of this InvoiceItem.  # noqa: E501
        :rtype: ItemQuantity
        """
        return self._invoiced_quantity

    @invoiced_quantity.setter
    def invoiced_quantity(self, invoiced_quantity):
        """Sets the invoiced_quantity of this InvoiceItem.


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

        self._invoiced_quantity = invoiced_quantity

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


        :return: The net_cost of this InvoiceItem.  # noqa: E501
        :rtype: Money
        """
        return self._net_cost

    @net_cost.setter
    def net_cost(self, net_cost):
        """Sets the net_cost of this InvoiceItem.


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

        self._net_cost = net_cost

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


        :return: The net_cost_unit_of_measure of this InvoiceItem.  # noqa: E501
        :rtype: NetCostUnitOfMeasure
        """
        return self._net_cost_unit_of_measure

    @net_cost_unit_of_measure.setter
    def net_cost_unit_of_measure(self, net_cost_unit_of_measure):
        """Sets the net_cost_unit_of_measure of this InvoiceItem.


        :param net_cost_unit_of_measure: The net_cost_unit_of_measure of this InvoiceItem.  # noqa: E501
        :type: NetCostUnitOfMeasure
        """

        self._net_cost_unit_of_measure = net_cost_unit_of_measure

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

        The Amazon purchase order number for this invoiced line item. Formatting Notes: 8-character alpha-numeric code. This value is mandatory only when invoiceType is Invoice, and is not required when invoiceType is CreditNote.  # noqa: E501

        :return: The purchase_order_number of this InvoiceItem.  # 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 InvoiceItem.

        The Amazon purchase order number for this invoiced line item. Formatting Notes: 8-character alpha-numeric code. This value is mandatory only when invoiceType is Invoice, and is not required when invoiceType is CreditNote.  # noqa: E501

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

        self._purchase_order_number = purchase_order_number

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

        HSN Tax code. The HSN number cannot contain alphabets.  # noqa: E501

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

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

        HSN Tax code. The HSN number cannot contain alphabets.  # noqa: E501

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

        self._hsn_code = hsn_code

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


        :return: The credit_note_details of this InvoiceItem.  # noqa: E501
        :rtype: CreditNoteDetails
        """
        return self._credit_note_details

    @credit_note_details.setter
    def credit_note_details(self, credit_note_details):
        """Sets the credit_note_details of this InvoiceItem.


        :param credit_note_details: The credit_note_details of this InvoiceItem.  # noqa: E501
        :type: CreditNoteDetails
        """

        self._credit_note_details = credit_note_details

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

        Individual tax details per line item.  # noqa: E501

        :return: The tax_details of this InvoiceItem.  # noqa: E501
        :rtype: List[TaxDetails]
        """
        return self._tax_details

    @tax_details.setter
    def tax_details(self, tax_details):
        """Sets the tax_details of this InvoiceItem.

        Individual tax details per line item.  # noqa: E501

        :param tax_details: The tax_details of this InvoiceItem.  # noqa: E501
        :type: List[TaxDetails]
        """

        self._tax_details = tax_details

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

        Individual charge details per line item.  # noqa: E501

        :return: The charge_details of this InvoiceItem.  # noqa: E501
        :rtype: List[ChargeDetails]
        """
        return self._charge_details

    @charge_details.setter
    def charge_details(self, charge_details):
        """Sets the charge_details of this InvoiceItem.

        Individual charge details per line item.  # noqa: E501

        :param charge_details: The charge_details of this InvoiceItem.  # noqa: E501
        :type: List[ChargeDetails]
        """

        self._charge_details = charge_details

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

        Individual allowance details per line item.  # noqa: E501

        :return: The allowance_details of this InvoiceItem.  # noqa: E501
        :rtype: List[AllowanceDetails]
        """
        return self._allowance_details

    @allowance_details.setter
    def allowance_details(self, allowance_details):
        """Sets the allowance_details of this InvoiceItem.

        Individual allowance details per line item.  # noqa: E501

        :param allowance_details: The allowance_details of this InvoiceItem.  # noqa: E501
        :type: List[AllowanceDetails]
        """

        self._allowance_details = allowance_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(InvoiceItem, 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, InvoiceItem):
            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, InvoiceItem):
            return True

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