"""visaacceptancemergedspec.

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

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


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

    Attributes:
        transaction_id (str): Processor transaction ID.  This value identifies the
            transaction on a host system. This value is supported only for Moneris.
            It contains this 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): Network Transaction Identifier Applicable for
            online capture transactions only.
        response_details (str): The processor code that describes why the transaction
            state is pending or reversed.
        response_code (str): For most processors, this is the error message sent
            directly from the bank. Returned only when the processor returns this
            value.  **Important** Do not use this field to evaluate the result of the
            authorization.  #### PIN debit Response value that is returned by the
            processor or bank. **Important** Do not use this field to evaluate the
            results of the transaction request.  Returned by PIN debit credit, PIN
            debit purchase, and PIN debit reversal.  #### AIBMS If this value is
            `08`, you can accept the transaction if the customer provides you with
            identification.  #### Atos This value is the response code sent from Atos
            and it might also include the response code from the bank. Format:
            `aa,bb` with the two values separated by a comma and where: - `aa` is the
            two-digit error message from Atos. - `bb` is the optional two-digit error
            message from the bank.  #### Comercio Latino This value is the status
            code and the error or response code received from the processor separated
            by a colon. Format: [status code]:E[error code] or [status
            code]:R[response code] Example `2:R06`  #### JCN Gateway
            Processor-defined detail error code. The associated response category
            code is in the `processorInformation.responseCategoryCode` field. String
            (3)  #### paypalgateway Processor generated ID for the itemized detail.
        provider_response (str): Processor response to the API request.
        update_time_utc (str): The date and time when the transaction was last
            updated, in Internet date and time format.
        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",
        "response_details": "responseDetails",
        "response_code": "responseCode",
        "provider_response": "providerResponse",
        "update_time_utc": "updateTimeUtc",
    }

    _optionals = [
        "transaction_id",
        "network_transaction_id",
        "response_details",
        "response_code",
        "provider_response",
        "update_time_utc",
    ]

    def __init__(
        self,
        transaction_id=APIHelper.SKIP,
        network_transaction_id=APIHelper.SKIP,
        response_details=APIHelper.SKIP,
        response_code=APIHelper.SKIP,
        provider_response=APIHelper.SKIP,
        update_time_utc=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessorInformation6 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 response_details is not APIHelper.SKIP:
            self.response_details = response_details
        if response_code is not APIHelper.SKIP:
            self.response_code = response_code
        if provider_response is not APIHelper.SKIP:
            self.provider_response = provider_response
        if update_time_utc is not APIHelper.SKIP:
            self.update_time_utc = update_time_utc

        # 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
        response_details =\
            dictionary.get("responseDetails")\
            if dictionary.get("responseDetails")\
                else APIHelper.SKIP
        response_code =\
            dictionary.get("responseCode")\
            if dictionary.get("responseCode")\
                else APIHelper.SKIP
        provider_response =\
            dictionary.get("providerResponse")\
            if dictionary.get("providerResponse")\
                else APIHelper.SKIP
        update_time_utc =\
            dictionary.get("updateTimeUtc")\
            if dictionary.get("updateTimeUtc")\
                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,
                   response_details,
                   response_code,
                   provider_response,
                   update_time_utc,
                   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
        )
        _response_details=(
            self.response_details
            if hasattr(self, "response_details")
            else None
        )
        _response_code=(
            self.response_code
            if hasattr(self, "response_code")
            else None
        )
        _provider_response=(
            self.provider_response
            if hasattr(self, "provider_response")
            else None
        )
        _update_time_utc=(
            self.update_time_utc
            if hasattr(self, "update_time_utc")
            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"response_details={_response_details!r}, "
            f"response_code={_response_code!r}, "
            f"provider_response={_provider_response!r}, "
            f"update_time_utc={_update_time_utc!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
        )
        _response_details=(
            self.response_details
            if hasattr(self, "response_details")
            else None
        )
        _response_code=(
            self.response_code
            if hasattr(self, "response_code")
            else None
        )
        _provider_response=(
            self.provider_response
            if hasattr(self, "provider_response")
            else None
        )
        _update_time_utc=(
            self.update_time_utc
            if hasattr(self, "update_time_utc")
            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"response_details={_response_details!s}, "
            f"response_code={_response_code!s}, "
            f"provider_response={_provider_response!s}, "
            f"update_time_utc={_update_time_utc!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
