"""visaacceptancemergedspec.

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

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


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

    Attributes:
        ip_country_confidence (int): Likelihood that the country associated with the
            customer’s IP address was identified correctly. Returns a value from
            1–100, where 100 indicates the highest likelihood. If the country cannot
            be determined, the value is –1.
        info_codes (List[str]): Returned when the Denied Parties List check (first
            two codes) or the export service (all others) would have declined the
            transaction. This field can contain one or more of these values: -
            `MATCH-DPC`: Denied Parties List match. - `UNV-DPC`: Denied Parties List
            unavailable. - `MATCH-BCO`: Billing country restricted. - `MATCH-EMCO`:
            Email country restricted. - `MATCH-HCO`: Host name country restricted. -
            `MATCH-IPCO`: IP country restricted. - `MATCH-SCO`: Shipping country
            restricted.
        watch_list (WatchList): The model property of type WatchList.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "ip_country_confidence": "ipCountryConfidence",
        "info_codes": "infoCodes",
        "watch_list": "watchList",
    }

    _optionals = [
        "ip_country_confidence",
        "info_codes",
        "watch_list",
    ]

    def __init__(
        self,
        ip_country_confidence=APIHelper.SKIP,
        info_codes=APIHelper.SKIP,
        watch_list=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a WatchlistScreeningInformation1 instance."""
        # Initialize members of the class
        if ip_country_confidence is not APIHelper.SKIP:
            self.ip_country_confidence = ip_country_confidence
        if info_codes is not APIHelper.SKIP:
            self.info_codes = info_codes
        if watch_list is not APIHelper.SKIP:
            self.watch_list = watch_list

        # 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
        ip_country_confidence =\
            dictionary.get("ipCountryConfidence")\
            if dictionary.get("ipCountryConfidence")\
                else APIHelper.SKIP
        info_codes =\
            dictionary.get("infoCodes")\
            if dictionary.get("infoCodes")\
                else APIHelper.SKIP
        watch_list =\
            WatchList.from_dictionary(
                dictionary.get("watchList"))\
                if "watchList" in dictionary.keys()\
                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(ip_country_confidence,
                   info_codes,
                   watch_list,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _ip_country_confidence=(
            self.ip_country_confidence
            if hasattr(self, "ip_country_confidence")
            else None
        )
        _info_codes=(
            self.info_codes
            if hasattr(self, "info_codes")
            else None
        )
        _watch_list=(
            self.watch_list
            if hasattr(self, "watch_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"ip_country_confidence={_ip_country_confidence!r}, "
            f"info_codes={_info_codes!r}, "
            f"watch_list={_watch_list!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _ip_country_confidence=(
            self.ip_country_confidence
            if hasattr(self, "ip_country_confidence")
            else None
        )
        _info_codes=(
            self.info_codes
            if hasattr(self, "info_codes")
            else None
        )
        _watch_list=(
            self.watch_list
            if hasattr(self, "watch_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"ip_country_confidence={_ip_country_confidence!s}, "
            f"info_codes={_info_codes!s}, "
            f"watch_list={_watch_list!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
