"""visaacceptancemergedspec.

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

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


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

    Attributes:
        addresses (List[str]): Address found on the list specified in
            export_matchN_list for the entity (name and address) in the request.
        sanction_list (str): List on which the first Denied Parties List check match
            appears. For a list of codes, see "Denied Parties List Check Codes," page
            56.
        aliases (List[str]): Name found on the list specified in export_matchN_list
            for the entity (name and address) in the request.
        programs (List[str]): Sub-lists matched by the order data. List members are
            separated by carets (^).
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "addresses": "addresses",
        "sanction_list": "sanctionList",
        "aliases": "aliases",
        "programs": "programs",
    }

    _optionals = [
        "addresses",
        "sanction_list",
        "aliases",
        "programs",
    ]

    def __init__(
        self,
        addresses=APIHelper.SKIP,
        sanction_list=APIHelper.SKIP,
        aliases=APIHelper.SKIP,
        programs=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Match instance."""
        # Initialize members of the class
        if addresses is not APIHelper.SKIP:
            self.addresses = addresses
        if sanction_list is not APIHelper.SKIP:
            self.sanction_list = sanction_list
        if aliases is not APIHelper.SKIP:
            self.aliases = aliases
        if programs is not APIHelper.SKIP:
            self.programs = programs

        # 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
        addresses =\
            dictionary.get("addresses")\
            if dictionary.get("addresses")\
                else APIHelper.SKIP
        sanction_list =\
            dictionary.get("sanctionList")\
            if dictionary.get("sanctionList")\
                else APIHelper.SKIP
        aliases =\
            dictionary.get("aliases")\
            if dictionary.get("aliases")\
                else APIHelper.SKIP
        programs =\
            dictionary.get("programs")\
            if dictionary.get("programs")\
                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(addresses,
                   sanction_list,
                   aliases,
                   programs,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _addresses=(
            self.addresses
            if hasattr(self, "addresses")
            else None
        )
        _sanction_list=(
            self.sanction_list
            if hasattr(self, "sanction_list")
            else None
        )
        _aliases=(
            self.aliases
            if hasattr(self, "aliases")
            else None
        )
        _programs=(
            self.programs
            if hasattr(self, "programs")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"addresses={_addresses!r}, "
            f"sanction_list={_sanction_list!r}, "
            f"aliases={_aliases!r}, "
            f"programs={_programs!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _addresses=(
            self.addresses
            if hasattr(self, "addresses")
            else None
        )
        _sanction_list=(
            self.sanction_list
            if hasattr(self, "sanction_list")
            else None
        )
        _aliases=(
            self.aliases
            if hasattr(self, "aliases")
            else None
        )
        _programs=(
            self.programs
            if hasattr(self, "programs")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"addresses={_addresses!s}, "
            f"sanction_list={_sanction_list!s}, "
            f"aliases={_aliases!s}, "
            f"programs={_programs!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
