"""visaacceptancemergedspec.

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

# ruff: noqa: E501
from visaacceptancemergedspec.api_helper import (
    APIHelper,
)


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

    Attributes:
        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
        network_transaction_id (str): Same value as
            `processorInformation.transactionId`
        payment_url (str): Direct the customer to this URL to complete the payment.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "transaction_id": "transactionId",
        "network_transaction_id": "networkTransactionId",
        "payment_url": "paymentUrl",
    }

    _optionals = [
        "transaction_id",
        "network_transaction_id",
        "payment_url",
    ]

    def __init__(
        self,
        transaction_id=APIHelper.SKIP,
        network_transaction_id=APIHelper.SKIP,
        payment_url=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessorInformation22 instance."""
        # Initialize members of the class
        if transaction_id is not APIHelper.SKIP:
            self.transaction_id = transaction_id
        if network_transaction_id is not APIHelper.SKIP:
            self.network_transaction_id = network_transaction_id
        if payment_url is not APIHelper.SKIP:
            self.payment_url = payment_url

        # 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
        transaction_id =\
            dictionary.get("transactionId")\
            if dictionary.get("transactionId")\
                else APIHelper.SKIP
        network_transaction_id =\
            dictionary.get("networkTransactionId")\
            if dictionary.get("networkTransactionId")\
                else APIHelper.SKIP
        payment_url =\
            dictionary.get("paymentUrl")\
            if dictionary.get("paymentUrl")\
                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(transaction_id,
                   network_transaction_id,
                   payment_url,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _transaction_id=(
            self.transaction_id
            if hasattr(self, "transaction_id")
            else None
        )
        _network_transaction_id=(
            self.network_transaction_id
            if hasattr(self, "network_transaction_id")
            else None
        )
        _payment_url=(
            self.payment_url
            if hasattr(self, "payment_url")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"transaction_id={_transaction_id!r}, "
            f"network_transaction_id={_network_transaction_id!r}, "
            f"payment_url={_payment_url!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _transaction_id=(
            self.transaction_id
            if hasattr(self, "transaction_id")
            else None
        )
        _network_transaction_id=(
            self.network_transaction_id
            if hasattr(self, "network_transaction_id")
            else None
        )
        _payment_url=(
            self.payment_url
            if hasattr(self, "payment_url")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"transaction_id={_transaction_id!s}, "
            f"network_transaction_id={_network_transaction_id!s}, "
            f"payment_url={_payment_url!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
