# coding: utf-8

"""
    Selling Partner API for Orders

    Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).

    The version of the OpenAPI document: v0
    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 PaymentExecutionDetailItem(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 = {
        'payment': 'Money',
        'payment_method': 'str',
        'acquirer_id': 'str',
        'card_brand': 'str',
        'authorization_code': 'str',
    }

    attribute_map = {
        'payment': 'Payment',
        'payment_method': 'PaymentMethod',
        'acquirer_id': 'AcquirerId',
        'card_brand': 'CardBrand',
        'authorization_code': 'AuthorizationCode',
    }

    def __init__(self, payment=None, payment_method=None, acquirer_id=None, card_brand=None, authorization_code=None, _configuration=None):  # noqa: E501
        """PaymentExecutionDetailItem - a model defined in Swagger"""  # noqa: E501
        if _configuration is None:
            _configuration = Configuration()
        self._configuration = _configuration

        self._payment = None
        self._payment_method = None
        self._acquirer_id = None
        self._card_brand = None
        self._authorization_code = None
        self.discriminator = None

        self.payment = payment
        self.payment_method = payment_method
        if acquirer_id is not None:
            self.acquirer_id = acquirer_id
        if card_brand is not None:
            self.card_brand = card_brand
        if authorization_code is not None:
            self.authorization_code = authorization_code

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


        :return: The payment of this PaymentExecutionDetailItem.  # noqa: E501
        :rtype: Money
        """
        return self._payment

    @payment.setter
    def payment(self, payment):
        """Sets the payment of this PaymentExecutionDetailItem.


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

        self._payment = payment

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

        The sub-payment method for an order.   **Possible values**: * `COD`: Cash on delivery  * `GC`: Gift card  * `PointsAccount`: Amazon Points  * `Invoice`: Invoice  * `CreditCard`: Credit card  * `Pix`: Pix  * `Other`: Other.  # noqa: E501

        :return: The payment_method of this PaymentExecutionDetailItem.  # noqa: E501
        :rtype: str
        """
        return self._payment_method

    @payment_method.setter
    def payment_method(self, payment_method):
        """Sets the payment_method of this PaymentExecutionDetailItem.

        The sub-payment method for an order.   **Possible values**: * `COD`: Cash on delivery  * `GC`: Gift card  * `PointsAccount`: Amazon Points  * `Invoice`: Invoice  * `CreditCard`: Credit card  * `Pix`: Pix  * `Other`: Other.  # noqa: E501

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

        self._payment_method = payment_method

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

        The Brazilian Taxpayer Identifier (CNPJ) of the payment processor or acquiring bank that authorizes the payment.   **Note**: This attribute is only available for orders in the Brazil (BR) marketplace when the `PaymentMethod` is `CreditCard` or `Pix`.  # noqa: E501

        :return: The acquirer_id of this PaymentExecutionDetailItem.  # noqa: E501
        :rtype: str
        """
        return self._acquirer_id

    @acquirer_id.setter
    def acquirer_id(self, acquirer_id):
        """Sets the acquirer_id of this PaymentExecutionDetailItem.

        The Brazilian Taxpayer Identifier (CNPJ) of the payment processor or acquiring bank that authorizes the payment.   **Note**: This attribute is only available for orders in the Brazil (BR) marketplace when the `PaymentMethod` is `CreditCard` or `Pix`.  # noqa: E501

        :param acquirer_id: The acquirer_id of this PaymentExecutionDetailItem.  # noqa: E501
        :type: str
        """

        self._acquirer_id = acquirer_id

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

        The card network or brand used in the payment transaction (for example, Visa or Mastercard).   **Note**: This attribute is only available for orders in the Brazil (BR) marketplace when the `PaymentMethod` is `CreditCard`.  # noqa: E501

        :return: The card_brand of this PaymentExecutionDetailItem.  # noqa: E501
        :rtype: str
        """
        return self._card_brand

    @card_brand.setter
    def card_brand(self, card_brand):
        """Sets the card_brand of this PaymentExecutionDetailItem.

        The card network or brand used in the payment transaction (for example, Visa or Mastercard).   **Note**: This attribute is only available for orders in the Brazil (BR) marketplace when the `PaymentMethod` is `CreditCard`.  # noqa: E501

        :param card_brand: The card_brand of this PaymentExecutionDetailItem.  # noqa: E501
        :type: str
        """

        self._card_brand = card_brand

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

        The unique code that confirms the payment authorization.   **Note**: This attribute is only available for orders in the Brazil (BR) marketplace when the `PaymentMethod` is `CreditCard` or `Pix`.  # noqa: E501

        :return: The authorization_code of this PaymentExecutionDetailItem.  # noqa: E501
        :rtype: str
        """
        return self._authorization_code

    @authorization_code.setter
    def authorization_code(self, authorization_code):
        """Sets the authorization_code of this PaymentExecutionDetailItem.

        The unique code that confirms the payment authorization.   **Note**: This attribute is only available for orders in the Brazil (BR) marketplace when the `PaymentMethod` is `CreditCard` or `Pix`.  # noqa: E501

        :param authorization_code: The authorization_code of this PaymentExecutionDetailItem.  # noqa: E501
        :type: str
        """

        self._authorization_code = authorization_code

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

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