"""visaacceptancemergedspec.

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

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


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

    Attributes:
        requestor_id (str): Value that identifies your business and indicates that
            the cardholder’s account number is tokenized. This value is assigned by
            the token service provider and is unique within the token service
            provider’s database.  **Note** This field is supported only through
            **VisaNet** and **FDC Nashville Global**.
        transaction_type (str): Type of transaction that provided the token data.
            This value does not specify the token service provider; it specifies the
            entity that provided you with information about the token.  Set the value
            for this field to 1. An application on the customer’s mobile device
            provided the token data.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "requestor_id": "requestorID",
        "transaction_type": "transactionType",
    }

    _optionals = [
        "requestor_id",
        "transaction_type",
    ]

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

        # 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
        requestor_id =\
            dictionary.get("requestorID")\
            if dictionary.get("requestorID")\
                else APIHelper.SKIP
        transaction_type =\
            dictionary.get("transactionType")\
            if dictionary.get("transactionType")\
                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(requestor_id,
                   transaction_type,
                   additional_properties)

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

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