# coding: utf-8

"""
    The Selling Partner API for Finances

    The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.

    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 Item(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 = {
        'description': 'str',
        'related_identifiers': 'List[ItemRelatedIdentifier]',
        'total_amount': 'Currency',
        'breakdowns': 'List[Breakdown]',
        'contexts': 'List[Context]',
    }

    attribute_map = {
        'description': 'description',
        'related_identifiers': 'relatedIdentifiers',
        'total_amount': 'totalAmount',
        'breakdowns': 'breakdowns',
        'contexts': 'contexts',
    }

    def __init__(self, description=None, related_identifiers=None, total_amount=None, breakdowns=None, contexts=None, _configuration=None):  # noqa: E501
        """Item - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._description = None
        self._related_identifiers = None
        self._total_amount = None
        self._breakdowns = None
        self._contexts = None
        self.discriminator = None

        if description is not None:
            self.description = description
        if related_identifiers is not None:
            self.related_identifiers = related_identifiers
        if total_amount is not None:
            self.total_amount = total_amount
        if breakdowns is not None:
            self.breakdowns = breakdowns
        if contexts is not None:
            self.contexts = contexts

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

        Description of items in the transaction  # noqa: E501

        :return: The description of this Item.  # noqa: E501
        :rtype: str
        """
        return self._description

    @description.setter
    def description(self, description):
        """Sets the description of this Item.

        Description of items in the transaction  # noqa: E501

        :param description: The description of this Item.  # noqa: E501
        :type: str
        """

        self._description = description

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

        Related Business identifiers of the item in Transaction.  # noqa: E501

        :return: The related_identifiers of this Item.  # noqa: E501
        :rtype: List[ItemRelatedIdentifier]
        """
        return self._related_identifiers

    @related_identifiers.setter
    def related_identifiers(self, related_identifiers):
        """Sets the related_identifiers of this Item.

        Related Business identifiers of the item in Transaction.  # noqa: E501

        :param related_identifiers: The related_identifiers of this Item.  # noqa: E501
        :type: List[ItemRelatedIdentifier]
        """

        self._related_identifiers = related_identifiers

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


        :return: The total_amount of this Item.  # noqa: E501
        :rtype: Currency
        """
        return self._total_amount

    @total_amount.setter
    def total_amount(self, total_amount):
        """Sets the total_amount of this Item.


        :param total_amount: The total_amount of this Item.  # noqa: E501
        :type: Currency
        """

        self._total_amount = total_amount

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

        A list of breakdowns that detail how the total amount is calculated for the transaction.  # noqa: E501

        :return: The breakdowns of this Item.  # noqa: E501
        :rtype: List[Breakdown]
        """
        return self._breakdowns

    @breakdowns.setter
    def breakdowns(self, breakdowns):
        """Sets the breakdowns of this Item.

        A list of breakdowns that detail how the total amount is calculated for the transaction.  # noqa: E501

        :param breakdowns: The breakdowns of this Item.  # noqa: E501
        :type: List[Breakdown]
        """

        self._breakdowns = breakdowns

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

        List of additional Information about the item.  # noqa: E501

        :return: The contexts of this Item.  # noqa: E501
        :rtype: List[Context]
        """
        return self._contexts

    @contexts.setter
    def contexts(self, contexts):
        """Sets the contexts of this Item.

        List of additional Information about the item.  # noqa: E501

        :param contexts: The contexts of this Item.  # noqa: E501
        :type: List[Context]
        """

        self._contexts = contexts

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

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