# coding: utf-8

"""
    Selling Partner API for Direct Fulfillment Payments

    The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice 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 InvoiceDetail(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 = {
        'invoice_number': 'str',
        'invoice_date': 'datetime',
        'reference_number': 'str',
        'remit_to_party': 'PartyIdentification',
        'ship_from_party': 'PartyIdentification',
        'bill_to_party': 'PartyIdentification',
        'ship_to_country_code': 'str',
        'payment_terms_code': 'str',
        'invoice_total': 'Money',
        'tax_totals': 'List[TaxDetail]',
        'additional_details': 'List[AdditionalDetails]',
        'charge_details': 'List[ChargeDetails]',
        'items': 'List[InvoiceItem]',
    }

    attribute_map = {
        'invoice_number': 'invoiceNumber',
        'invoice_date': 'invoiceDate',
        'reference_number': 'referenceNumber',
        'remit_to_party': 'remitToParty',
        'ship_from_party': 'shipFromParty',
        'bill_to_party': 'billToParty',
        'ship_to_country_code': 'shipToCountryCode',
        'payment_terms_code': 'paymentTermsCode',
        'invoice_total': 'invoiceTotal',
        'tax_totals': 'taxTotals',
        'additional_details': 'additionalDetails',
        'charge_details': 'chargeDetails',
        'items': 'items',
    }

    def __init__(self, invoice_number=None, invoice_date=None, reference_number=None, remit_to_party=None, ship_from_party=None, bill_to_party=None, ship_to_country_code=None, payment_terms_code=None, invoice_total=None, tax_totals=None, additional_details=None, charge_details=None, items=None, _configuration=None):  # noqa: E501
        """InvoiceDetail - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._invoice_number = None
        self._invoice_date = None
        self._reference_number = None
        self._remit_to_party = None
        self._ship_from_party = None
        self._bill_to_party = None
        self._ship_to_country_code = None
        self._payment_terms_code = None
        self._invoice_total = None
        self._tax_totals = None
        self._additional_details = None
        self._charge_details = None
        self._items = None
        self.discriminator = None

        self.invoice_number = invoice_number
        self.invoice_date = invoice_date
        if reference_number is not None:
            self.reference_number = reference_number
        self.remit_to_party = remit_to_party
        self.ship_from_party = ship_from_party
        if bill_to_party is not None:
            self.bill_to_party = bill_to_party
        if ship_to_country_code is not None:
            self.ship_to_country_code = ship_to_country_code
        if payment_terms_code is not None:
            self.payment_terms_code = payment_terms_code
        self.invoice_total = invoice_total
        if tax_totals is not None:
            self.tax_totals = tax_totals
        if additional_details is not None:
            self.additional_details = additional_details
        if charge_details is not None:
            self.charge_details = charge_details
        self.items = items

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

        The unique invoice number.  # noqa: E501

        :return: The invoice_number of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._invoice_number

    @invoice_number.setter
    def invoice_number(self, invoice_number):
        """Sets the invoice_number of this InvoiceDetail.

        The unique invoice number.  # noqa: E501

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

        self._invoice_number = invoice_number

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

        Invoice date.  # noqa: E501

        :return: The invoice_date of this InvoiceDetail.  # noqa: E501
        :rtype: datetime
        """
        return self._invoice_date

    @invoice_date.setter
    def invoice_date(self, invoice_date):
        """Sets the invoice_date of this InvoiceDetail.

        Invoice date.  # noqa: E501

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

        self._invoice_date = invoice_date

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

        An additional unique reference number used for regulatory or other purposes.  # noqa: E501

        :return: The reference_number of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._reference_number

    @reference_number.setter
    def reference_number(self, reference_number):
        """Sets the reference_number of this InvoiceDetail.

        An additional unique reference number used for regulatory or other purposes.  # noqa: E501

        :param reference_number: The reference_number of this InvoiceDetail.  # noqa: E501
        :type: str
        """

        self._reference_number = reference_number

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


        :return: The remit_to_party of this InvoiceDetail.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._remit_to_party

    @remit_to_party.setter
    def remit_to_party(self, remit_to_party):
        """Sets the remit_to_party of this InvoiceDetail.


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

        self._remit_to_party = remit_to_party

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


        :return: The ship_from_party of this InvoiceDetail.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._ship_from_party

    @ship_from_party.setter
    def ship_from_party(self, ship_from_party):
        """Sets the ship_from_party of this InvoiceDetail.


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

        self._ship_from_party = ship_from_party

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


        :return: The bill_to_party of this InvoiceDetail.  # noqa: E501
        :rtype: PartyIdentification
        """
        return self._bill_to_party

    @bill_to_party.setter
    def bill_to_party(self, bill_to_party):
        """Sets the bill_to_party of this InvoiceDetail.


        :param bill_to_party: The bill_to_party of this InvoiceDetail.  # noqa: E501
        :type: PartyIdentification
        """

        self._bill_to_party = bill_to_party

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

        Ship-to country code.  # noqa: E501

        :return: The ship_to_country_code of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._ship_to_country_code

    @ship_to_country_code.setter
    def ship_to_country_code(self, ship_to_country_code):
        """Sets the ship_to_country_code of this InvoiceDetail.

        Ship-to country code.  # noqa: E501

        :param ship_to_country_code: The ship_to_country_code of this InvoiceDetail.  # noqa: E501
        :type: str
        """

        self._ship_to_country_code = ship_to_country_code

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

        The payment terms for the invoice.  # noqa: E501

        :return: The payment_terms_code of this InvoiceDetail.  # noqa: E501
        :rtype: str
        """
        return self._payment_terms_code

    @payment_terms_code.setter
    def payment_terms_code(self, payment_terms_code):
        """Sets the payment_terms_code of this InvoiceDetail.

        The payment terms for the invoice.  # noqa: E501

        :param payment_terms_code: The payment_terms_code of this InvoiceDetail.  # noqa: E501
        :type: str
        """

        self._payment_terms_code = payment_terms_code

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


        :return: The invoice_total of this InvoiceDetail.  # noqa: E501
        :rtype: Money
        """
        return self._invoice_total

    @invoice_total.setter
    def invoice_total(self, invoice_total):
        """Sets the invoice_total of this InvoiceDetail.


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

        self._invoice_total = invoice_total

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

        Individual tax details per line item.  # noqa: E501

        :return: The tax_totals of this InvoiceDetail.  # noqa: E501
        :rtype: List[TaxDetail]
        """
        return self._tax_totals

    @tax_totals.setter
    def tax_totals(self, tax_totals):
        """Sets the tax_totals of this InvoiceDetail.

        Individual tax details per line item.  # noqa: E501

        :param tax_totals: The tax_totals of this InvoiceDetail.  # noqa: E501
        :type: List[TaxDetail]
        """

        self._tax_totals = tax_totals

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

        Additional details provided by the selling party, for tax-related or other purposes.  # noqa: E501

        :return: The additional_details of this InvoiceDetail.  # noqa: E501
        :rtype: List[AdditionalDetails]
        """
        return self._additional_details

    @additional_details.setter
    def additional_details(self, additional_details):
        """Sets the additional_details of this InvoiceDetail.

        Additional details provided by the selling party, for tax-related or other purposes.  # noqa: E501

        :param additional_details: The additional_details of this InvoiceDetail.  # noqa: E501
        :type: List[AdditionalDetails]
        """

        self._additional_details = additional_details

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

        Total charge amount details for all line items.  # noqa: E501

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

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

        Total charge amount details for all line items.  # noqa: E501

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

        self._charge_details = charge_details

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

        Provides the details of the items in this invoice.  # noqa: E501

        :return: The items of this InvoiceDetail.  # noqa: E501
        :rtype: List[InvoiceItem]
        """
        return self._items

    @items.setter
    def items(self, items):
        """Sets the items of this InvoiceDetail.

        Provides the details of the items in this invoice.  # noqa: E501

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

        self._items = items

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

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