"""visaacceptancemergedspec.

This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ).
"""

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)
from visaacceptancemergedspec.models.avs_1 import (
    Avs1,
)
from visaacceptancemergedspec.models.seller_protection_3 import (
    SellerProtection3,
)


class ProcessorInformation19(object):
    """Implementation of the 'ProcessorInformation19' model.

    Attributes:
        seller_protection (SellerProtection3): The model property of type
            SellerProtection3.
        avs (Avs1): The model property of type Avs1.
        transaction_id (str): Network transaction identifier (TID). You can use this
            value to identify a specific transaction when you are discussing the
            transaction with your processor. Not all processors provide this value.
            Returned by the authorization service.  #### PIN debit Transaction
            identifier generated by the processor.  Returned by PIN debit credit.
            #### GPX Processor transaction ID.  #### Cielo For Cielo, this value is
            the non-sequential unit (NSU) and is supported for all transactions. The
            value is generated by Cielo or the issuing bank.  #### Comercio Latino
            For Comercio Latino, this value is the proof of sale or non-sequential
            unit (NSU) number generated by the acquirers Cielo and Rede, or the
            issuing bank.  #### Visa Acceptance through VisaNet and GPN For details
            about this value for Visa Acceptance through VisaNet and GPN, see
            "processorInformation.networkTransactionId" in [REST API Fields](  ####
            Moneris This value identifies the transaction on a host system. It
            contains the following information: - Terminal used to process the
            transaction - Shift during which the transaction took place - Batch
            number - Transaction number within the batch You must store this value.
            If you give the customer a receipt, display this value on the receipt.
            **Example** For the value 66012345001069003: - Terminal ID = 66012345 -
            Shift number = 001 - Batch number = 069 - Transaction number = 003
        response_details (str): This field might contain information about a decline.
            This field is supported only for **Visa Acceptance through VisaNet**.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "seller_protection": "sellerProtection",
        "avs": "avs",
        "transaction_id": "transactionId",
        "response_details": "responseDetails",
    }

    _optionals = [
        "seller_protection",
        "avs",
        "transaction_id",
        "response_details",
    ]

    def __init__(
        self,
        seller_protection=APIHelper.SKIP,
        avs=APIHelper.SKIP,
        transaction_id=APIHelper.SKIP,
        response_details=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessorInformation19 instance."""
        # Initialize members of the class
        if seller_protection is not APIHelper.SKIP:
            self.seller_protection = seller_protection
        if avs is not APIHelper.SKIP:
            self.avs = avs
        if transaction_id is not APIHelper.SKIP:
            self.transaction_id = transaction_id
        if response_details is not APIHelper.SKIP:
            self.response_details = response_details

        # Add additional model properties to the instance
        if additional_properties is None:
            additional_properties = {}
        self.additional_properties = additional_properties

    @classmethod
    def from_dictionary(cls,
                        dictionary):
        """Create an instance of this model from a dictionary

        Args:
            dictionary (dictionary): A dictionary representation of the object
            as obtained from the deserialization of the server's response. The
            keys MUST match property names in the API description.

        Returns:
            object: An instance of this structure class.

        """
        if not isinstance(dictionary, dict) or dictionary is None:
            return None

        # Extract variables from the dictionary
        seller_protection =\
            SellerProtection3.from_dictionary(
                dictionary.get("sellerProtection"))\
                if "sellerProtection" in dictionary.keys()\
                else APIHelper.SKIP
        avs =\
            Avs1.from_dictionary(
                dictionary.get("avs"))\
                if "avs" in dictionary.keys()\
                else APIHelper.SKIP
        transaction_id =\
            dictionary.get("transactionId")\
            if dictionary.get("transactionId")\
                else APIHelper.SKIP
        response_details =\
            dictionary.get("responseDetails")\
            if dictionary.get("responseDetails")\
                else APIHelper.SKIP

        additional_properties = APIHelper.get_additional_properties(
            dictionary={k: v for k, v in dictionary.items()
                        if k not in cls._names.values()},
            unboxing_function=lambda value: value)

        # Return an object of this model
        return cls(seller_protection,
                   avs,
                   transaction_id,
                   response_details,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _seller_protection=(
            self.seller_protection
            if hasattr(self, "seller_protection")
            else None
        )
        _avs=(
            self.avs
            if hasattr(self, "avs")
            else None
        )
        _transaction_id=(
            self.transaction_id
            if hasattr(self, "transaction_id")
            else None
        )
        _response_details=(
            self.response_details
            if hasattr(self, "response_details")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"seller_protection={_seller_protection!r}, "
            f"avs={_avs!r}, "
            f"transaction_id={_transaction_id!r}, "
            f"response_details={_response_details!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _seller_protection=(
            self.seller_protection
            if hasattr(self, "seller_protection")
            else None
        )
        _avs=(
            self.avs
            if hasattr(self, "avs")
            else None
        )
        _transaction_id=(
            self.transaction_id
            if hasattr(self, "transaction_id")
            else None
        )
        _response_details=(
            self.response_details
            if hasattr(self, "response_details")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"seller_protection={_seller_protection!s}, "
            f"avs={_avs!s}, "
            f"transaction_id={_transaction_id!s}, "
            f"response_details={_response_details!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
