"""visaacceptancemergedspec.

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

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


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

    Attributes:
        low_value_exemption_indicator (str): This field will contain the low value
            exemption indicator with one of the following values: Possible values: -
            `0`  ( low value exemption does not apply to the transaction) - `1`
            (Transaction exempt from SCA as the merchant/acquirer has determined it
            to be a low value payment)
        risk_analysis_exemption_indicator (str): This field will contain the
            transaction risk analysis exemption indicator with one of the following
            values: Possible values: - `0`  (TRA exemption does not apply to the
            transaction) - `1` (Transaction exempt from SCA as the merchant/acquirer
            has determined it to be low risk in accordance with the criteria defined
            by PSD2/RTS)
        trusted_merchant_exemption_indicator (str): Possible values: - `0`  (Trusted
            merchant exemption does not apply to the transaction) - `1` (Transaction
            exempt from SCA as it originated at a merchant trusted by the cardholder)
        secure_corporate_payment_indicator (str): This field will contain the secure
            corporate payment exemption indicator with one of the following values:
            Possible values: - `0`  (SCA exemption does not apply to the transaction)
            - `1` (Transaction exempt from SCA as the merchant/acquirer has
            determined it as a secure corporate payment)
        delegated_authentication_exemption_indicator (str): This field will contain
            the delegated authentication exemption indicator with one of the
            following values: Possible values: - `0`  (delegated Authentication
            exemption does not apply to the transaction) - `1` (Transaction exempt
            from SCA as authentication has been delegated to other provider
            (PSP,Acquirer))
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "low_value_exemption_indicator": "lowValueExemptionIndicator",
        "risk_analysis_exemption_indicator": "riskAnalysisExemptionIndicator",
        "trusted_merchant_exemption_indicator": "trustedMerchantExemptionIndicator",
        "secure_corporate_payment_indicator": "secureCorporatePaymentIndicator",
        "delegated_authentication_exemption_indicator":
            "delegatedAuthenticationExemptionIndicator",
    }

    _optionals = [
        "low_value_exemption_indicator",
        "risk_analysis_exemption_indicator",
        "trusted_merchant_exemption_indicator",
        "secure_corporate_payment_indicator",
        "delegated_authentication_exemption_indicator",
    ]

    def __init__(
        self,
        low_value_exemption_indicator=APIHelper.SKIP,
        risk_analysis_exemption_indicator=APIHelper.SKIP,
        trusted_merchant_exemption_indicator=APIHelper.SKIP,
        secure_corporate_payment_indicator=APIHelper.SKIP,
        delegated_authentication_exemption_indicator=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a StrongAuthentication2 instance."""
        # Initialize members of the class
        if low_value_exemption_indicator is not APIHelper.SKIP:
            self.low_value_exemption_indicator = low_value_exemption_indicator
        if risk_analysis_exemption_indicator is not APIHelper.SKIP:
            self.risk_analysis_exemption_indicator =\
                 risk_analysis_exemption_indicator
        if trusted_merchant_exemption_indicator is not APIHelper.SKIP:
            self.trusted_merchant_exemption_indicator =\
                 trusted_merchant_exemption_indicator
        if secure_corporate_payment_indicator is not APIHelper.SKIP:
            self.secure_corporate_payment_indicator =\
                 secure_corporate_payment_indicator
        if delegated_authentication_exemption_indicator is not APIHelper.SKIP:
            self.delegated_authentication_exemption_indicator =\
                 delegated_authentication_exemption_indicator

        # 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
        low_value_exemption_indicator =\
            dictionary.get("lowValueExemptionIndicator")\
            if dictionary.get("lowValueExemptionIndicator")\
                else APIHelper.SKIP
        risk_analysis_exemption_indicator =\
            dictionary.get("riskAnalysisExemptionIndicator")\
            if dictionary.get("riskAnalysisExemptionIndicator")\
                else APIHelper.SKIP
        trusted_merchant_exemption_indicator =\
            dictionary.get("trustedMerchantExemptionIndicator")\
            if dictionary.get("trustedMerchantExemptionIndicator")\
                else APIHelper.SKIP
        secure_corporate_payment_indicator =\
            dictionary.get("secureCorporatePaymentIndicator")\
            if dictionary.get("secureCorporatePaymentIndicator")\
                else APIHelper.SKIP
        delegated_authentication_exemption_indicator =\
            dictionary.get("delegatedAuthenticationExemptionIndicator")\
            if dictionary.get("delegatedAuthenticationExemptionIndicator")\
                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(low_value_exemption_indicator,
                   risk_analysis_exemption_indicator,
                   trusted_merchant_exemption_indicator,
                   secure_corporate_payment_indicator,
                   delegated_authentication_exemption_indicator,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _low_value_exemption_indicator=(
            self.low_value_exemption_indicator
            if hasattr(self, "low_value_exemption_indicator")
            else None
        )
        _risk_analysis_exemption_indicator=(
            self.risk_analysis_exemption_indicator
            if hasattr(self, "risk_analysis_exemption_indicator")
            else None
        )
        _trusted_merchant_exemption_indicator=(
            self.trusted_merchant_exemption_indicator
            if hasattr(self, "trusted_merchant_exemption_indicator")
            else None
        )
        _secure_corporate_payment_indicator=(
            self.secure_corporate_payment_indicator
            if hasattr(self, "secure_corporate_payment_indicator")
            else None
        )
        _delegated_authentication_exemption_indicator=(
            self.delegated_authentication_exemption_indicator
            if hasattr(self, "delegated_authentication_exemption_indicator")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"low_value_exemption_indicator={_low_value_exemption_indicator!r}, "
            f"risk_analysis_exemption_indicator={_risk_analysis_exemption_indicator!r}, "
            f"trusted_merchant_exemption_indicator={_trusted_merchant_exemption_indicator!r}, "
            f"secure_corporate_payment_indicator={_secure_corporate_payment_indicator!r}, "
            f"delegated_authentication_exemption_indicator={_delegated_authentication_exemption_indicator!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _low_value_exemption_indicator=(
            self.low_value_exemption_indicator
            if hasattr(self, "low_value_exemption_indicator")
            else None
        )
        _risk_analysis_exemption_indicator=(
            self.risk_analysis_exemption_indicator
            if hasattr(self, "risk_analysis_exemption_indicator")
            else None
        )
        _trusted_merchant_exemption_indicator=(
            self.trusted_merchant_exemption_indicator
            if hasattr(self, "trusted_merchant_exemption_indicator")
            else None
        )
        _secure_corporate_payment_indicator=(
            self.secure_corporate_payment_indicator
            if hasattr(self, "secure_corporate_payment_indicator")
            else None
        )
        _delegated_authentication_exemption_indicator=(
            self.delegated_authentication_exemption_indicator
            if hasattr(self, "delegated_authentication_exemption_indicator")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"low_value_exemption_indicator={_low_value_exemption_indicator!s}, "
            f"risk_analysis_exemption_indicator={_risk_analysis_exemption_indicator!s}, "
            f"trusted_merchant_exemption_indicator={_trusted_merchant_exemption_indicator!s}, "
            f"secure_corporate_payment_indicator={_secure_corporate_payment_indicator!s}, "
            f"delegated_authentication_exemption_indicator={_delegated_authentication_exemption_indicator!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
