"""visaacceptancemergedspec.

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

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


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

    Attributes:
        discretionary_data (str): Data defined by the issuer.  The value for this
            reply field will probably be the same as the value that you submitted in
            the authorization request, but it is possible for the processor, issuer,
            or acquirer to modify the value.  This field is supported only for Visa
            transactions on **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 = {
        "discretionary_data": "discretionaryData",
    }

    _optionals = [
        "discretionary_data",
    ]

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

        # 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
        discretionary_data =\
            dictionary.get("discretionaryData")\
            if dictionary.get("discretionaryData")\
                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(discretionary_data,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _discretionary_data=(
            self.discretionary_data
            if hasattr(self, "discretionary_data")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"discretionary_data={_discretionary_data!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _discretionary_data=(
            self.discretionary_data
            if hasattr(self, "discretionary_data")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"discretionary_data={_discretionary_data!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
