"""visaacceptancemergedspec.

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

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


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

    Contains auxiliary key-value pairs.

    Attributes:
        key (str): Fields that you can use to send additional data to Risk services.
            **Warning** Auxiliary fields are not intended to and MUST NOT be used to
            capture personally identifying information. Accordingly, merchants are
            prohibited from capturing, obtaining, and/or transmitting any personally
            identifying information in or via the auxiliary data fields. Personally
            identifying information includes, but is not limited to, address, credit
            card number, social security number, driver's license number,
            state-issued identification number, passport number, and card
            verification numbers (CVV, CVC2, CVV2, CID, CVN). In the event Visa
            Acceptance discovers that a merchant is capturing and/or transmitting
            personally identifying information via the auxiliary data fields, whether
            or not intentionally, Visa Acceptance WILL immediately suspend the
            merchant's account, which will result in a rejection of any and all
            transaction requests submitted by the merchant after the point of
            suspension.
        value (str): String value for the key
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "key": "key",
        "value": "value",
    }

    _optionals = [
        "key",
        "value",
    ]

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

        # 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
        key =\
            dictionary.get("key")\
            if dictionary.get("key")\
                else APIHelper.SKIP
        value =\
            dictionary.get("value")\
            if dictionary.get("value")\
                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(key,
                   value,
                   additional_properties)

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

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