"""visaacceptancemergedspec.

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

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


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

    Attributes:
        address (str): Degree of correlation between a customer’s address and an
            entry in the DPL before a match occurs. This field can contain one of the
            following values: - exact: The address must be identical to the entry in
            the DPL. - high: (default) The address cannot differ significantly from
            the entry in the DPL. - medium: The address can differ slightly more from
            the entry in the DPL. - low: The address can differ significantly from
            the entry in the DPL.
        company (str): Degree of correlation between a company address and an entry
            in the DPL before a match occurs. This field can contain one of the
            following values: - exact: The company name must be identical to the
            entry in the DPL. - high: (default) The company name cannot differ
            significantly from the entry in the DPL. - medium: The company name can
            differ slightly more from the entry in the DPL. - low: The company name
            can differ significantly from the entry in the DPL.
        name (str): Degree of correlation between a customer’s name and an entry in
            the DPL before a match occurs. This field can contain one of the
            following values: - exact: The name must be identical to the entry in the
            DPL. - high: (default) The name cannot differ significantly from the
            entry in the DPL. - medium: The name can differ slightly more from the
            entry in the DPL. - low: The name can differ significantly the entry in
            the DPL.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "address": "address",
        "company": "company",
        "name": "name",
    }

    _optionals = [
        "address",
        "company",
        "name",
    ]

    def __init__(
        self,
        address=APIHelper.SKIP,
        company=APIHelper.SKIP,
        name=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Weights instance."""
        # Initialize members of the class
        if address is not APIHelper.SKIP:
            self.address = address
        if company is not APIHelper.SKIP:
            self.company = company
        if name is not APIHelper.SKIP:
            self.name = name

        # 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 =\
            dictionary.get("address")\
            if dictionary.get("address")\
                else APIHelper.SKIP
        company =\
            dictionary.get("company")\
            if dictionary.get("company")\
                else APIHelper.SKIP
        name =\
            dictionary.get("name")\
            if dictionary.get("name")\
                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,
                   company,
                   name,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _company=(
            self.company
            if hasattr(self, "company")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"address={_address!r}, "
            f"company={_company!r}, "
            f"name={_name!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _address=(
            self.address
            if hasattr(self, "address")
            else None
        )
        _company=(
            self.company
            if hasattr(self, "company")
            else None
        )
        _name=(
            self.name
            if hasattr(self, "name")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"address={_address!s}, "
            f"company={_company!s}, "
            f"name={_name!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
