"""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.bank_transfer_options_4 import (
    BankTransferOptions4,
)


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

    Attributes:
        bill_payment_program_enabled (bool): Flag that indicates that this is a
            payment for a bill or for an existing contractual loan. Possible Values:
            - `true`: Bill payment or loan payment. - `false` (default): Not a bill
            payment or loan payment. # For processor-specific details, see the
            `bill_payment` field description in [Credit Card Services Using the SCMP
            API.](
        bank_transfer_options (BankTransferOptions4): The model property of type
            BankTransferOptions4.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "bill_payment_program_enabled": "billPaymentProgramEnabled",
        "bank_transfer_options": "bankTransferOptions",
    }

    _optionals = [
        "bill_payment_program_enabled",
        "bank_transfer_options",
    ]

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

        # 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
        bill_payment_program_enabled =\
            dictionary.get("billPaymentProgramEnabled")\
            if "billPaymentProgramEnabled" in dictionary.keys()\
                else APIHelper.SKIP
        bank_transfer_options =\
            BankTransferOptions4.from_dictionary(
                dictionary.get("bankTransferOptions"))\
                if "bankTransferOptions" 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(bill_payment_program_enabled,
                   bank_transfer_options,
                   additional_properties)

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

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