"""visaacceptancemergedspec.

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

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


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

    Attributes:
        number (str): Account number of the sender of the funds. For Gaming Payment
            of Winnings transactions this is the merchant account number. * Required
            for Mastercard Payment of Winnings (POW) transactions. * Must contain
            only ASCII characters in range 32-122. * Must not be greater than 50
            characters. * Required for POW on Barclays.
        funds_source (str): Source of funds for the sender. For Gaming Payment of
            Winnings transactions this is the merchant account type. * Required for
            Mastercard Payment of Winnings (POW) transactions. * Valid values:   * 00
            - Other   * 01 - RTN + Bank Account   * 02 - IBAN   * 03 - Card Account
            * 04 - Email   * 05 - PhoneNumber   * 06 - Bank account number (BAN) +
            Bank Identification Code (BIC)   * 07 - Wallet ID   * 08 - Social Network
            ID
        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",
        "funds_source": "fundsSource",
    }

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

    def __init__(
        self,
        number=APIHelper.SKIP,
        funds_source=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a Account6 instance."""
        # Initialize members of the class
        if number is not APIHelper.SKIP:
            self.number = number
        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
        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,
                   funds_source,
                   additional_properties)

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