"""paypalserversdk.

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

# ruff: noqa: E501
class AssuranceDetails(object):
    """Implementation of the 'Assurance Details' model.

    Information about cardholder possession validation and cardholder identification
    and verifications (ID&V).

    Attributes:
        account_verified (bool): If true, indicates that Cardholder possession
            validation has been performed on returned payment credential.
        card_holder_authenticated (bool): If true, indicates that identification and
            verifications (ID&V) was performed on the returned payment credential.If
            false, the same risk-based authentication can be performed as you would
            for card transactions. This risk-based authentication can include, but
            not limited to, step-up with 3D Secure protocol if applicable.

    """

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

    _optionals = [
        "account_verified",
        "card_holder_authenticated",
    ]

    def __init__(
        self,
        account_verified=False,
        card_holder_authenticated=False):
        """Initialize a AssuranceDetails instance."""
        # Initialize members of the class
        self.account_verified = account_verified
        self.card_holder_authenticated = card_holder_authenticated

    @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
        account_verified =\
            dictionary.get("account_verified")\
            if dictionary.get("account_verified")\
                else False
        card_holder_authenticated =\
            dictionary.get("card_holder_authenticated")\
            if dictionary.get("card_holder_authenticated")\
                else False

        # Return an object of this model
        return cls(account_verified,
                   card_holder_authenticated)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _account_verified=(
            self.account_verified
            if hasattr(self, "account_verified")
            else None
        )
        _card_holder_authenticated=(
            self.card_holder_authenticated
            if hasattr(self, "card_holder_authenticated")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"account_verified={_account_verified!r}, "
            f"card_holder_authenticated={_card_holder_authenticated!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _account_verified=(
            self.account_verified
            if hasattr(self, "account_verified")
            else None
        )
        _card_holder_authenticated=(
            self.card_holder_authenticated
            if hasattr(self, "card_holder_authenticated")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"account_verified={_account_verified!s}, "
            f"card_holder_authenticated={_card_holder_authenticated!s}, "
            f")"
        )
