"""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.bin_lookup import (
    BinLookup,
)


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

    Attributes:
        bin_lookup (BinLookup): The model property of type BinLookup.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "bin_lookup": "binLookup",
    }

    _optionals = [
        "bin_lookup",
    ]

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

        # 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
        bin_lookup =\
            BinLookup.from_dictionary(
                dictionary.get("binLookup"))\
                if "binLookup" 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(bin_lookup,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _bin_lookup=(
            self.bin_lookup
            if hasattr(self, "bin_lookup")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"bin_lookup={_bin_lookup!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _bin_lookup=(
            self.bin_lookup
            if hasattr(self, "bin_lookup")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"bin_lookup={_bin_lookup!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
