"""visaacceptancemergedspec.

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

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


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

    Attributes:
        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.
        response_details (str): The reason for when the transaction status is Pending
            or Reversed. Possible values: - `PAYER_SHIPPING_UNCONFIRMED` -
            `MULTI_CURRENCY` - `RISK_REVIEW` - `REGULATORY_REVIEW` -
            `VERIFICATION_REQUIRED` - `ORDER` - `OTHER`
        transaction_id (str): Identifier of the order transaction.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

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

    _optionals = [
        "response_code",
        "response_details",
        "transaction_id",
    ]

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

        # 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
        response_code =\
            dictionary.get("responseCode")\
            if dictionary.get("responseCode")\
                else APIHelper.SKIP
        response_details =\
            dictionary.get("responseDetails")\
            if dictionary.get("responseDetails")\
                else APIHelper.SKIP
        transaction_id =\
            dictionary.get("transactionId")\
            if dictionary.get("transactionId")\
                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(response_code,
                   response_details,
                   transaction_id,
                   additional_properties)

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

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