# coding: utf-8

"""
    The Selling Partner API for Invoices.

    Use the Selling Partner API for Invoices to retrieve and manage invoice-related operations, which can help selling partners manage their bookkeeping processes.

    The version of the OpenAPI document: 2024-06-19
    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 Invoice(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 = {
        'var_date': 'datetime',
        'error_code': 'str',
        'external_invoice_id': 'str',
        'gov_response': 'str',
        'id': 'str',
        'invoice_type': 'str',
        'series': 'str',
        'status': 'str',
        'transaction_ids': 'List[TransactionIdentifier]',
        'transaction_type': 'str',
    }

    attribute_map = {
        'var_date': 'date',
        'error_code': 'errorCode',
        'external_invoice_id': 'externalInvoiceId',
        'gov_response': 'govResponse',
        'id': 'id',
        'invoice_type': 'invoiceType',
        'series': 'series',
        'status': 'status',
        'transaction_ids': 'transactionIds',
        'transaction_type': 'transactionType',
    }

    def __init__(self, var_date=None, error_code=None, external_invoice_id=None, gov_response=None, id=None, invoice_type=None, series=None, status=None, transaction_ids=None, transaction_type=None, _configuration=None):  # noqa: E501
        """Invoice - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._var_date = None
        self._error_code = None
        self._external_invoice_id = None
        self._gov_response = None
        self._id = None
        self._invoice_type = None
        self._series = None
        self._status = None
        self._transaction_ids = None
        self._transaction_type = None
        self.discriminator = None

        if var_date is not None:
            self.var_date = var_date
        if error_code is not None:
            self.error_code = error_code
        if external_invoice_id is not None:
            self.external_invoice_id = external_invoice_id
        if gov_response is not None:
            self.gov_response = gov_response
        if id is not None:
            self.id = id
        if invoice_type is not None:
            self.invoice_type = invoice_type
        if series is not None:
            self.series = series
        if status is not None:
            self.status = status
        if transaction_ids is not None:
            self.transaction_ids = transaction_ids
        if transaction_type is not None:
            self.transaction_type = transaction_type

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

        The date and time the invoice is issued. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.  # noqa: E501

        :return: The var_date of this Invoice.  # noqa: E501
        :rtype: datetime
        """
        return self._var_date

    @var_date.setter
    def var_date(self, var_date):
        """Sets the var_date of this Invoice.

        The date and time the invoice is issued. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.  # noqa: E501

        :param var_date: The var_date of this Invoice.  # noqa: E501
        :type: datetime
        """

        self._var_date = var_date

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

        If the invoice is in an error state, this attribute displays the error code.  # noqa: E501

        :return: The error_code of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._error_code

    @error_code.setter
    def error_code(self, error_code):
        """Sets the error_code of this Invoice.

        If the invoice is in an error state, this attribute displays the error code.  # noqa: E501

        :param error_code: The error_code of this Invoice.  # noqa: E501
        :type: str
        """

        self._error_code = error_code

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

        The invoice identifier that is used by an external party. This is typically the government agency that authorized the invoice.  # noqa: E501

        :return: The external_invoice_id of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._external_invoice_id

    @external_invoice_id.setter
    def external_invoice_id(self, external_invoice_id):
        """Sets the external_invoice_id of this Invoice.

        The invoice identifier that is used by an external party. This is typically the government agency that authorized the invoice.  # noqa: E501

        :param external_invoice_id: The external_invoice_id of this Invoice.  # noqa: E501
        :type: str
        """

        self._external_invoice_id = external_invoice_id

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

        The response message from the government authority when there is an error during invoice issuance.  # noqa: E501

        :return: The gov_response of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._gov_response

    @gov_response.setter
    def gov_response(self, gov_response):
        """Sets the gov_response of this Invoice.

        The response message from the government authority when there is an error during invoice issuance.  # noqa: E501

        :param gov_response: The gov_response of this Invoice.  # noqa: E501
        :type: str
        """

        self._gov_response = gov_response

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

        The invoice identifier.  # noqa: E501

        :return: The id of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._id

    @id.setter
    def id(self, id):
        """Sets the id of this Invoice.

        The invoice identifier.  # noqa: E501

        :param id: The id of this Invoice.  # noqa: E501
        :type: str
        """

        self._id = id

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

        The classification of the invoice type. This varies across marketplaces. Use the `getInvoicesAttributes` operation to check `invoiceType` options.  # noqa: E501

        :return: The invoice_type of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._invoice_type

    @invoice_type.setter
    def invoice_type(self, invoice_type):
        """Sets the invoice_type of this Invoice.

        The classification of the invoice type. This varies across marketplaces. Use the `getInvoicesAttributes` operation to check `invoiceType` options.  # noqa: E501

        :param invoice_type: The invoice_type of this Invoice.  # noqa: E501
        :type: str
        """

        self._invoice_type = invoice_type

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

        Use this identifier in conjunction with `externalInvoiceId` to identify invoices from the same seller.  # noqa: E501

        :return: The series of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._series

    @series.setter
    def series(self, series):
        """Sets the series of this Invoice.

        Use this identifier in conjunction with `externalInvoiceId` to identify invoices from the same seller.  # noqa: E501

        :param series: The series of this Invoice.  # noqa: E501
        :type: str
        """

        self._series = series

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

        The invoice status classification. Use the `getInvoicesAttributes` operation to check invoice status options.  # noqa: E501

        :return: The status of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._status

    @status.setter
    def status(self, status):
        """Sets the status of this Invoice.

        The invoice status classification. Use the `getInvoicesAttributes` operation to check invoice status options.  # noqa: E501

        :param status: The status of this Invoice.  # noqa: E501
        :type: str
        """

        self._status = status

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

        List with identifiers for the transactions associated to the invoice.  # noqa: E501

        :return: The transaction_ids of this Invoice.  # noqa: E501
        :rtype: List[TransactionIdentifier]
        """
        return self._transaction_ids

    @transaction_ids.setter
    def transaction_ids(self, transaction_ids):
        """Sets the transaction_ids of this Invoice.

        List with identifiers for the transactions associated to the invoice.  # noqa: E501

        :param transaction_ids: The transaction_ids of this Invoice.  # noqa: E501
        :type: List[TransactionIdentifier]
        """

        self._transaction_ids = transaction_ids

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

        Classification of the transaction that originated this invoice. Use the `getInvoicesAttributes` operation to check `transactionType` options.  # noqa: E501

        :return: The transaction_type of this Invoice.  # noqa: E501
        :rtype: str
        """
        return self._transaction_type

    @transaction_type.setter
    def transaction_type(self, transaction_type):
        """Sets the transaction_type of this Invoice.

        Classification of the transaction that originated this invoice. Use the `getInvoicesAttributes` operation to check `transactionType` options.  # noqa: E501

        :param transaction_type: The transaction_type of this Invoice.  # noqa: E501
        :type: str
        """

        self._transaction_type = transaction_type

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

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