"""visaacceptancemergedspec.

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

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


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

    Attributes:
        velocity (List[str]): List of information codes triggered by the order. These
            information codes were generated when you created the order and product
            velocity rules and are returned so that you can associate them with the
            rules.
        address (List[str]): Indicates a mismatch between the customer’s billing and
            shipping addresses.
        customer_list (List[str]): Indicates that customer information is associated
            with transactions that are either on the negative or the positive list.
        device_behavior (List[str]): Indicates the device behavior information
            code(s) returned from device fingerprinting.
        identity_change (List[str]): Indicates excessive identity changes. The
            threshold is variable depending on the identity elements being compared.
        internet (List[str]): Indicates a problem with the customer’s email address,
            IP address, or billing address.
        phone (List[str]): Indicates a problem with the customer’s phone number.
        suspicious (List[str]): Indicates that the customer provided potentially
            suspicious information.
        global_velocity (List[str]): Indicates that the customer has a high purchase
            frequency.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "velocity": "velocity",
        "address": "address",
        "customer_list": "customerList",
        "device_behavior": "deviceBehavior",
        "identity_change": "identityChange",
        "internet": "internet",
        "phone": "phone",
        "suspicious": "suspicious",
        "global_velocity": "globalVelocity",
    }

    _optionals = [
        "velocity",
        "address",
        "customer_list",
        "device_behavior",
        "identity_change",
        "internet",
        "phone",
        "suspicious",
        "global_velocity",
    ]

    def __init__(
        self,
        velocity=APIHelper.SKIP,
        address=APIHelper.SKIP,
        customer_list=APIHelper.SKIP,
        device_behavior=APIHelper.SKIP,
        identity_change=APIHelper.SKIP,
        internet=APIHelper.SKIP,
        phone=APIHelper.SKIP,
        suspicious=APIHelper.SKIP,
        global_velocity=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a InfoCodes instance."""
        # Initialize members of the class
        if velocity is not APIHelper.SKIP:
            self.velocity = velocity
        if address is not APIHelper.SKIP:
            self.address = address
        if customer_list is not APIHelper.SKIP:
            self.customer_list = customer_list
        if device_behavior is not APIHelper.SKIP:
            self.device_behavior = device_behavior
        if identity_change is not APIHelper.SKIP:
            self.identity_change = identity_change
        if internet is not APIHelper.SKIP:
            self.internet = internet
        if phone is not APIHelper.SKIP:
            self.phone = phone
        if suspicious is not APIHelper.SKIP:
            self.suspicious = suspicious
        if global_velocity is not APIHelper.SKIP:
            self.global_velocity = global_velocity

        # 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
        velocity =\
            dictionary.get("velocity")\
            if dictionary.get("velocity")\
                else APIHelper.SKIP
        address =\
            dictionary.get("address")\
            if dictionary.get("address")\
                else APIHelper.SKIP
        customer_list =\
            dictionary.get("customerList")\
            if dictionary.get("customerList")\
                else APIHelper.SKIP
        device_behavior =\
            dictionary.get("deviceBehavior")\
            if dictionary.get("deviceBehavior")\
                else APIHelper.SKIP
        identity_change =\
            dictionary.get("identityChange")\
            if dictionary.get("identityChange")\
                else APIHelper.SKIP
        internet =\
            dictionary.get("internet")\
            if dictionary.get("internet")\
                else APIHelper.SKIP
        phone =\
            dictionary.get("phone")\
            if dictionary.get("phone")\
                else APIHelper.SKIP
        suspicious =\
            dictionary.get("suspicious")\
            if dictionary.get("suspicious")\
                else APIHelper.SKIP
        global_velocity =\
            dictionary.get("globalVelocity")\
            if dictionary.get("globalVelocity")\
                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(velocity,
                   address,
                   customer_list,
                   device_behavior,
                   identity_change,
                   internet,
                   phone,
                   suspicious,
                   global_velocity,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _velocity=(
            self.velocity
            if hasattr(self, "velocity")
            else None
        )
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _customer_list=(
            self.customer_list
            if hasattr(self, "customer_list")
            else None
        )
        _device_behavior=(
            self.device_behavior
            if hasattr(self, "device_behavior")
            else None
        )
        _identity_change=(
            self.identity_change
            if hasattr(self, "identity_change")
            else None
        )
        _internet=(
            self.internet
            if hasattr(self, "internet")
            else None
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _suspicious=(
            self.suspicious
            if hasattr(self, "suspicious")
            else None
        )
        _global_velocity=(
            self.global_velocity
            if hasattr(self, "global_velocity")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"velocity={_velocity!r}, "
            f"address={_address!r}, "
            f"customer_list={_customer_list!r}, "
            f"device_behavior={_device_behavior!r}, "
            f"identity_change={_identity_change!r}, "
            f"internet={_internet!r}, "
            f"phone={_phone!r}, "
            f"suspicious={_suspicious!r}, "
            f"global_velocity={_global_velocity!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _velocity=(
            self.velocity
            if hasattr(self, "velocity")
            else None
        )
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _customer_list=(
            self.customer_list
            if hasattr(self, "customer_list")
            else None
        )
        _device_behavior=(
            self.device_behavior
            if hasattr(self, "device_behavior")
            else None
        )
        _identity_change=(
            self.identity_change
            if hasattr(self, "identity_change")
            else None
        )
        _internet=(
            self.internet
            if hasattr(self, "internet")
            else None
        )
        _phone=(
            self.phone
            if hasattr(self, "phone")
            else None
        )
        _suspicious=(
            self.suspicious
            if hasattr(self, "suspicious")
            else None
        )
        _global_velocity=(
            self.global_velocity
            if hasattr(self, "global_velocity")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"velocity={_velocity!s}, "
            f"address={_address!s}, "
            f"customer_list={_customer_list!s}, "
            f"device_behavior={_device_behavior!s}, "
            f"identity_change={_identity_change!s}, "
            f"internet={_internet!s}, "
            f"phone={_phone!s}, "
            f"suspicious={_suspicious!s}, "
            f"global_velocity={_global_velocity!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
