"""visaacceptancemergedspec.

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

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


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

    Attributes:
        descriptor (str): The identifier for a payment solution, which is sending the
            encrypted payment data for decryption. Valid values: Samsung Pay:
            RklEPUNPTU1PTi5TQU1TVU5HLklOQVBQLlBBWU1FTlQ= Note: For other payment
            solutions, the value may be specific to the terminal or device initiatinf
            the payment. For example, the descriptor for a Bluefin payment encryption
            would be a device-generated descriptor. Used by Authorization and
            Standalone Credits. Required for authorizations and standalone credits.
            Card Present processing: Format of the encrypted payment data. The value
            for Bluefin PCI P2PE is `Ymx1ZWZpbg==`.
            paymentInformation.fluidData.encoding must be `Base64`. The value for
            Visa Acceptance P2PE decryption depends on the encoding method used and
            identified in encoding field. If paymentInformation.fluidData.encoding is
            `Base64`, the value is: `RklEPUVNVi5QQVlNRU5ULkFQSQ==` If
            paymentInformation.fluidData.encoding is `HEX`, the value is:
            `4649443D454D562E5041594D454E542E41504`
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

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

    _optionals = [
        "descriptor",
    ]

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

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

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

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