"""paypalserversdk.

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

# ruff: noqa: E501
class CardVerification(object):
    """Implementation of the 'Card Verification' model.

    The API caller can opt in to verify the card through PayPal offered verification
    services (e.g. Smart Dollar Auth, 3DS).

    Attributes:
        method (OrdersCardVerificationMethod): The method used for card verification.

    """

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

    _optionals = [
        "method",
    ]

    def __init__(
        self,
        method="SCA_WHEN_REQUIRED"):
        """Initialize a CardVerification instance."""
        # Initialize members of the class
        self.method = method

    @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
        method =\
            dictionary.get("method")\
            if dictionary.get("method")\
                else "SCA_WHEN_REQUIRED"

        # Return an object of this model
        return cls(method)

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

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