"""visaacceptancemergedspec.

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

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


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

    Attributes:
        enabled_message (bool): Flag to indicate if a valid IVR transaction was
            detected.
        encryption_key (str): Encryption key to be used in the event the ACS requires
            encryption of the credential field.
        encryption_mandatory (bool): Flag to indicate if the ACS requires the
            credential to be encrypted.
        encryption_type (str): An indicator from the ACS to inform the type of
            encryption that should be used in the event the ACS requires encryption
            of the credential field.
        label (str): An ACS Provided label that can be presented to the Consumer.
            Recommended use with an application.
        prompt (str): An ACS provided string that can be presented to the Consumer.
            Recommended use with an application.
        status_message (str): An ACS provided message that can provide additional
            information or details.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "enabled_message": "enabledMessage",
        "encryption_key": "encryptionKey",
        "encryption_mandatory": "encryptionMandatory",
        "encryption_type": "encryptionType",
        "label": "label",
        "prompt": "prompt",
        "status_message": "statusMessage",
    }

    _optionals = [
        "enabled_message",
        "encryption_key",
        "encryption_mandatory",
        "encryption_type",
        "label",
        "prompt",
        "status_message",
    ]

    def __init__(
        self,
        enabled_message=APIHelper.SKIP,
        encryption_key=APIHelper.SKIP,
        encryption_mandatory=APIHelper.SKIP,
        encryption_type=APIHelper.SKIP,
        label=APIHelper.SKIP,
        prompt=APIHelper.SKIP,
        status_message=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Ivr instance."""
        # Initialize members of the class
        if enabled_message is not APIHelper.SKIP:
            self.enabled_message = enabled_message
        if encryption_key is not APIHelper.SKIP:
            self.encryption_key = encryption_key
        if encryption_mandatory is not APIHelper.SKIP:
            self.encryption_mandatory = encryption_mandatory
        if encryption_type is not APIHelper.SKIP:
            self.encryption_type = encryption_type
        if label is not APIHelper.SKIP:
            self.label = label
        if prompt is not APIHelper.SKIP:
            self.prompt = prompt
        if status_message is not APIHelper.SKIP:
            self.status_message = status_message

        # 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
        enabled_message =\
            dictionary.get("enabledMessage")\
            if "enabledMessage" in dictionary.keys()\
                else APIHelper.SKIP
        encryption_key =\
            dictionary.get("encryptionKey")\
            if dictionary.get("encryptionKey")\
                else APIHelper.SKIP
        encryption_mandatory =\
            dictionary.get("encryptionMandatory")\
            if "encryptionMandatory" in dictionary.keys()\
                else APIHelper.SKIP
        encryption_type =\
            dictionary.get("encryptionType")\
            if dictionary.get("encryptionType")\
                else APIHelper.SKIP
        label =\
            dictionary.get("label")\
            if dictionary.get("label")\
                else APIHelper.SKIP
        prompt =\
            dictionary.get("prompt")\
            if dictionary.get("prompt")\
                else APIHelper.SKIP
        status_message =\
            dictionary.get("statusMessage")\
            if dictionary.get("statusMessage")\
                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(enabled_message,
                   encryption_key,
                   encryption_mandatory,
                   encryption_type,
                   label,
                   prompt,
                   status_message,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _enabled_message=(
            self.enabled_message
            if hasattr(self, "enabled_message")
            else None
        )
        _encryption_key=(
            self.encryption_key
            if hasattr(self, "encryption_key")
            else None
        )
        _encryption_mandatory=(
            self.encryption_mandatory
            if hasattr(self, "encryption_mandatory")
            else None
        )
        _encryption_type=(
            self.encryption_type
            if hasattr(self, "encryption_type")
            else None
        )
        _label=(
            self.label
            if hasattr(self, "label")
            else None
        )
        _prompt=(
            self.prompt
            if hasattr(self, "prompt")
            else None
        )
        _status_message=(
            self.status_message
            if hasattr(self, "status_message")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"enabled_message={_enabled_message!r}, "
            f"encryption_key={_encryption_key!r}, "
            f"encryption_mandatory={_encryption_mandatory!r}, "
            f"encryption_type={_encryption_type!r}, "
            f"label={_label!r}, "
            f"prompt={_prompt!r}, "
            f"status_message={_status_message!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _enabled_message=(
            self.enabled_message
            if hasattr(self, "enabled_message")
            else None
        )
        _encryption_key=(
            self.encryption_key
            if hasattr(self, "encryption_key")
            else None
        )
        _encryption_mandatory=(
            self.encryption_mandatory
            if hasattr(self, "encryption_mandatory")
            else None
        )
        _encryption_type=(
            self.encryption_type
            if hasattr(self, "encryption_type")
            else None
        )
        _label=(
            self.label
            if hasattr(self, "label")
            else None
        )
        _prompt=(
            self.prompt
            if hasattr(self, "prompt")
            else None
        )
        _status_message=(
            self.status_message
            if hasattr(self, "status_message")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"enabled_message={_enabled_message!s}, "
            f"encryption_key={_encryption_key!s}, "
            f"encryption_mandatory={_encryption_mandatory!s}, "
            f"encryption_type={_encryption_type!s}, "
            f"label={_label!s}, "
            f"prompt={_prompt!s}, "
            f"status_message={_status_message!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
