"""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.weights import (
    Weights,
)


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

    Attributes:
        address_operator (str): Parts of the customer’s information that must match
            with an entry in the DPL (denied parties list) before a match occurs.
            This field can contain one of the following values: - AND: (default) The
            customer’s name or company and the customer’s address must appear in the
            database. - OR: The customer’s name must appear in the database. -
            IGNORE: You want the service to detect a match only of the customer’s
            name or company but not of the address.
        weights (Weights): The model property of type Weights.
        sanction_lists (List[str]): Use this field to specify which list(s) you want
            checked with the request. The reply will include the list name as well as
            the response data. To check against multiple lists, enter multiple list
            codes separated by a caret (^). For more information, see "Restricted and
            Denied Parties List," page 68.
        proceed_on_match (bool): Indicates whether the transaction should proceed if
            there is a match. Possible values: - `true`: Transaction proceeds even
            when match is found in the Denied Parties List. The match is noted in the
            response. - `false`: Normal watchlist screening behavior occurs.
            (Transaction stops if a match to DPL occurs. Transaction proceeds if no
            match.)
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "address_operator": "addressOperator",
        "weights": "weights",
        "sanction_lists": "sanctionLists",
        "proceed_on_match": "proceedOnMatch",
    }

    _optionals = [
        "address_operator",
        "weights",
        "sanction_lists",
        "proceed_on_match",
    ]

    def __init__(
        self,
        address_operator=APIHelper.SKIP,
        weights=APIHelper.SKIP,
        sanction_lists=APIHelper.SKIP,
        proceed_on_match=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a WatchlistScreeningInformation instance."""
        # Initialize members of the class
        if address_operator is not APIHelper.SKIP:
            self.address_operator = address_operator
        if weights is not APIHelper.SKIP:
            self.weights = weights
        if sanction_lists is not APIHelper.SKIP:
            self.sanction_lists = sanction_lists
        if proceed_on_match is not APIHelper.SKIP:
            self.proceed_on_match = proceed_on_match

        # 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
        address_operator =\
            dictionary.get("addressOperator")\
            if dictionary.get("addressOperator")\
                else APIHelper.SKIP
        weights =\
            Weights.from_dictionary(
                dictionary.get("weights"))\
                if "weights" in dictionary.keys()\
                else APIHelper.SKIP
        sanction_lists =\
            dictionary.get("sanctionLists")\
            if dictionary.get("sanctionLists")\
                else APIHelper.SKIP
        proceed_on_match =\
            dictionary.get("proceedOnMatch")\
            if "proceedOnMatch" 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(address_operator,
                   weights,
                   sanction_lists,
                   proceed_on_match,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _address_operator=(
            self.address_operator
            if hasattr(self, "address_operator")
            else None
        )
        _weights=(
            self.weights
            if hasattr(self, "weights")
            else None
        )
        _sanction_lists=(
            self.sanction_lists
            if hasattr(self, "sanction_lists")
            else None
        )
        _proceed_on_match=(
            self.proceed_on_match
            if hasattr(self, "proceed_on_match")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"address_operator={_address_operator!r}, "
            f"weights={_weights!r}, "
            f"sanction_lists={_sanction_lists!r}, "
            f"proceed_on_match={_proceed_on_match!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _address_operator=(
            self.address_operator
            if hasattr(self, "address_operator")
            else None
        )
        _weights=(
            self.weights
            if hasattr(self, "weights")
            else None
        )
        _sanction_lists=(
            self.sanction_lists
            if hasattr(self, "sanction_lists")
            else None
        )
        _proceed_on_match=(
            self.proceed_on_match
            if hasattr(self, "proceed_on_match")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"address_operator={_address_operator!s}, "
            f"weights={_weights!s}, "
            f"sanction_lists={_sanction_lists!s}, "
            f"proceed_on_match={_proceed_on_match!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
