"""visaacceptancemergedspec.

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

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


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

    Attributes:
        number (str): Account number.  When processing encoded account numbers, use
            this field for the encoded account number.
        iban (str): International Bank Account Number (IBAN) for the bank account.
            For some countries you can provide this number instead of the traditional
            bank account information. You can use this field only when scoring a
            direct debit transaction.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

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

    _optionals = [
        "number",
        "iban",
    ]

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

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

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

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