"""visaacceptancemergedspec.

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

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


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

    Attributes:
        fraud_decision (str): Type of filter. Possible values: - ACCEPT - PENDING -
            DENY - REPORT
        fraud_decision_reason (str): possible values - AVS_NO_MATCH -
            AVS_PARTIAL_MATCH - AVS_UNAVAILABLE_OR_UNSUPPORTED -
            CARD_SECURITY_CODE_MISMATCH - MAXIMUM_TRANSACTION_AMOUNT -
            UNCONFIRMED_ADDRESS - COUNTRY_MONITOR - LARGE_ORDER_NUMBER -
            BILLING_OR_SHIPPING_ADDRESS_MISMATCH - RISKY_ZIP_CODE -
            SUSPECTED_FREIGHT_FORWARDER_CHECK - TOTAL_PURCHASE_PRICE_MINIMUM -
            IP_ADDRESS_VELOCITY - RISKY_EMAIL_ADDRESS_DOMAIN_CHECK -
            RISKY_BANK_IDENTIFICATION_NUMBER_CHECK, RISKY_IP_ADDRESS_RANGE -
            PAYPAL_FRAUD_MODEL
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "fraud_decision": "fraudDecision",
        "fraud_decision_reason": "fraudDecisionReason",
    }

    _optionals = [
        "fraud_decision",
        "fraud_decision_reason",
    ]

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

        # 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
        fraud_decision =\
            dictionary.get("fraudDecision")\
            if dictionary.get("fraudDecision")\
                else APIHelper.SKIP
        fraud_decision_reason =\
            dictionary.get("fraudDecisionReason")\
            if dictionary.get("fraudDecisionReason")\
                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(fraud_decision,
                   fraud_decision_reason,
                   additional_properties)

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

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