"""visaacceptancemergedspec.

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

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


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

    Attributes:
        include_card_prefix (bool): Use the
            transientTokenResponseOptions.includeCardPrefix field to choose your
            preferred card number prefix length: 6-digit, 8-digit, or no card number
            prefix.  Possible values: - True - False<br><br>  To select the type of
            card number prefix: - No field included: A 6-digit prefix is returned
            (default) - True: An 8-digit prefix is returned - False: No prefix is
            returned<br><br>  The following conditions apply: - 8-digit card number
            prefixes only apply to Discover, JCB, Mastercard, UnionPay, and Visa
            brands with 16-digit card numbers or more. - Any card with less than
            16-digit numbers will return a 6-digit prefix even when the
            transientTokenResponseOptions.includeCardPrefix field is set to true. -
            Any card brand other than Discover, JCB, Mastercard, UnionPay, or Visa
            will return a 6-digit prefix even when the
            transientTokenResponseOptions.includeCardPrefix field is set to true. -
            If any card brand is co-branded with Discover, JCB, Mastercard, UnionPay,
            or Visa, an 8-digit prefix will be returned if the
            transientTokenResponseOptions.includeCardPrefix field is set to
            true.<br><br>  **Important:**  If your application does NOT require a
            card number prefix for routing or identification purposes, set the
            transientTokenResponseOptions.includeCardPrefix field to False.  This
            will minimize your personal data exposure.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

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

    _optionals = [
        "include_card_prefix",
    ]

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

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

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

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