"""visaacceptancemergedspec.

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

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


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

    Attributes:
        name (str): The number you assign as the name for your merchant-defined data
            or secure field. Possible Values are data1 to data4 and sensitive1 to
            sensitive4  For example, to set the name for merchant-defined data 2
            field, you would reference merchantDefinedInformation[x].name as data2
            Possible Values: - data1 - data2 - data3 - data4 - sensitive1 -
            sensitive2 - sensitive3 - sensitive4
        value (str): The value you assign for your merchant-defined data field.
            **Warning** Merchant-defined data 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 merchant-defined
            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 it is
            discovered a merchant is capturing and/or transmitting personally
            identifying information via the merchant-defined data fields, whether or
            not intentionally, the merchant's account will immediately be suspended,
            which will result in a rejection of any and all transaction requests
            submitted by the merchant after the point of suspension.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

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

    _optionals = [
        "name",
        "value",
    ]

    def __init__(
        self,
        name=APIHelper.SKIP,
        value=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a MerchantDefinedInformation7 instance."""
        # Initialize members of the class
        if name is not APIHelper.SKIP:
            self.name = name
        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
        name =\
            dictionary.get("name")\
            if dictionary.get("name")\
                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(name,
                   value,
                   additional_properties)

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

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