"""visaacceptancemergedspec.

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

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


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

    Attributes:
        response_code (str): This is the raw Association/Issuer Response Codes. You
            can use ‘issuer/association’ response codes to identify when you can
            retry to authorize a declined transaction and increase successful
            transaction volumes. You’ll receive an association/issuer response code
            for the majority of transactions.  #### Processors supported:   - HSBC
            - FDC Nashville Global   - SIX  Currently SIX is not receiving
            Association/Issuer Response Codes here it receives the additional
            authorization code that must be printed on the receipt when returned by
            the processor.  #### Possible values: | Card Type   | Response Code |
            Description
            | | ----------- | ------------- |
            --------------------------------------------------------------------------
            ---- | | VISA        | 000           | Successful approval/completion or
            that V.I.P. PIN verification is successful   | | VISA        | 001
            | Refer to card issuer
            | | VISA        | 002           | Refer to card issuer, special condition
            | | VISA        | 003           | Invalid merchant or service provider
            | | VISA        | 004           | Pickup card
            |   | MasterCard  | 000           | Approved or completed successfully
            | | MasterCard  | 001           | Refer to card issuer
            | | MasterCard  | 003           | Invalid merchant
            | | MasterCard  | 004           | Capture card
            | | MasterCard  | 005           | Do not honor
            | | AMEX        | 000           | Approved
            | | AMEX        | 001           | Approve with ID
            | | AMEX        | 002           | Partial Approval (Prepaid Cards only)
            | | AMEX        | 100           | Deny
            | | AMEX        | 101           | Expired Card/Invalid Expiration Date
            | | Discover    | 000           | Approved or completed successfully
            | | Discover    | 001           | Reserved for future USE
            | | Discover    | 002           | Reserved for future USE
            | | Discover    | 003           | Invalid Merchant
            | | Discover    | 004           | Capture Card
            |
        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",
    }

    _optionals = [
        "response_code",
    ]

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

        # 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

        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,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _response_code=(
            self.response_code
            if hasattr(self, "response_code")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"response_code={_response_code!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
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"response_code={_response_code!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
