"""mindbodypublicapi.

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

# ruff: noqa: E501
from mindbodypublicapi.api_helper import APIHelper


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

    Attributes:
        test (bool): When `true`, indicates that test mode is enabled. The
            information is to be validated, but no data will be added or updated.
            Default: **false**
        client_id (str): The ID of the client being updated
        name_on_account (str): The name on the bank account being added
        routing_number (str): The routing number of the bank account being added
        account_number (str): The bank account number
        account_type (str): The account type.    Possible values:  * Checking  *
            Savings

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "test": "Test",
        "client_id": "ClientId",
        "name_on_account": "NameOnAccount",
        "routing_number": "RoutingNumber",
        "account_number": "AccountNumber",
        "account_type": "AccountType",
    }

    _optionals = [
        "test",
        "client_id",
        "name_on_account",
        "routing_number",
        "account_number",
        "account_type",
    ]

    def __init__(
        self,
        test=APIHelper.SKIP,
        client_id=APIHelper.SKIP,
        name_on_account=APIHelper.SKIP,
        routing_number=APIHelper.SKIP,
        account_number=APIHelper.SKIP,
        account_type=APIHelper.SKIP):
        """Initialize a AddClientDirectDebitInfoRequest instance."""
        # Initialize members of the class
        if test is not APIHelper.SKIP:
            self.test = test
        if client_id is not APIHelper.SKIP:
            self.client_id = client_id
        if name_on_account is not APIHelper.SKIP:
            self.name_on_account = name_on_account
        if routing_number is not APIHelper.SKIP:
            self.routing_number = routing_number
        if account_number is not APIHelper.SKIP:
            self.account_number = account_number
        if account_type is not APIHelper.SKIP:
            self.account_type = account_type

    @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
        test =\
            dictionary.get("Test")\
            if "Test" in dictionary.keys()\
                else APIHelper.SKIP
        client_id =\
            dictionary.get("ClientId")\
            if dictionary.get("ClientId")\
                else APIHelper.SKIP
        name_on_account =\
            dictionary.get("NameOnAccount")\
            if dictionary.get("NameOnAccount")\
                else APIHelper.SKIP
        routing_number =\
            dictionary.get("RoutingNumber")\
            if dictionary.get("RoutingNumber")\
                else APIHelper.SKIP
        account_number =\
            dictionary.get("AccountNumber")\
            if dictionary.get("AccountNumber")\
                else APIHelper.SKIP
        account_type =\
            dictionary.get("AccountType")\
            if dictionary.get("AccountType")\
                else APIHelper.SKIP

        # Return an object of this model
        return cls(test,
                   client_id,
                   name_on_account,
                   routing_number,
                   account_number,
                   account_type)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _name_on_account=(
            self.name_on_account
            if hasattr(self, "name_on_account")
            else None
        )
        _routing_number=(
            self.routing_number
            if hasattr(self, "routing_number")
            else None
        )
        _account_number=(
            self.account_number
            if hasattr(self, "account_number")
            else None
        )
        _account_type=(
            self.account_type
            if hasattr(self, "account_type")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"test={_test!r}, "
            f"client_id={_client_id!r}, "
            f"name_on_account={_name_on_account!r}, "
            f"routing_number={_routing_number!r}, "
            f"account_number={_account_number!r}, "
            f"account_type={_account_type!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _test=(
            self.test
            if hasattr(self, "test")
            else None
        )
        _client_id=(
            self.client_id
            if hasattr(self, "client_id")
            else None
        )
        _name_on_account=(
            self.name_on_account
            if hasattr(self, "name_on_account")
            else None
        )
        _routing_number=(
            self.routing_number
            if hasattr(self, "routing_number")
            else None
        )
        _account_number=(
            self.account_number
            if hasattr(self, "account_number")
            else None
        )
        _account_type=(
            self.account_type
            if hasattr(self, "account_type")
            else None
        )
        return (
            f"{self.__class__.__name__}("
            f"test={_test!s}, "
            f"client_id={_client_id!s}, "
            f"name_on_account={_name_on_account!s}, "
            f"routing_number={_routing_number!s}, "
            f"account_number={_account_number!s}, "
            f"account_type={_account_type!s}, "
            f")"
        )
