"""visaacceptancemergedspec.

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

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


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

    Attributes:
        number (str): The account number of the entity funding the transaction. The
            value for this field can be a payment card account number or bank account
            number.
        mtype (str): Identifies the sender’s account type. This field is applicable
            for AFT transactions.  Valid values are:   - `00` for Other   - `01` for
            Routing Transit Number (RTN) + Bank Account Number (BAN)   - `02` for
            International Bank Account Number (IBAN)   - `03` for Card Account   -
            `04` for Email   - `05` for Phone Number   - `06` for Bank Account Number
            (BAN) + Bank Identification Code (BIC), also known as a SWIFT code   -
            `07` for Wallet ID   - `08` for Social Network ID
        funds_source (str): Source of funds. Possible Values:  - `01`: Credit.  -
            `02`: Debit.  - `03`: Prepaid.  - `04`: Deposit Account.  - `05`: Mobile
            Money Account.  - `06`: Cash.  - `07`: Other.  - `V5`: Debits / deposit
            access other than those linked to the cardholders’ scheme.  - `V6`:
            Credit accounts other than those linked to the cardholder’s scheme.
        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",
        "mtype": "type",
        "funds_source": "fundsSource",
    }

    _optionals = [
        "number",
        "mtype",
        "funds_source",
    ]

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

        # 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
        mtype =\
            dictionary.get("type")\
            if dictionary.get("type")\
                else APIHelper.SKIP
        funds_source =\
            dictionary.get("fundsSource")\
            if dictionary.get("fundsSource")\
                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,
                   mtype,
                   funds_source,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _number=(
            self.number
            if hasattr(self, "number")
            else None
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _funds_source=(
            self.funds_source
            if hasattr(self, "funds_source")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"number={_number!r}, "
            f"mtype={_mtype!r}, "
            f"funds_source={_funds_source!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
        )
        _mtype=(
            self.mtype
            if hasattr(self, "mtype")
            else None
        )
        _funds_source=(
            self.funds_source
            if hasattr(self, "funds_source")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"number={_number!s}, "
            f"mtype={_mtype!s}, "
            f"funds_source={_funds_source!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
