"""visaacceptancemergedspec.

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

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


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

    Attributes:
        customer_memo (str): Payment related information.  This information is
            included on the customer’s statement.
        sec_code (str): Specifies the authorization method for the transaction.  ####
            TeleCheck Accepts only the following values: - `ARC`: account receivable
            conversion - `CCD`: corporate cash disbursement - `POP`: point of
            purchase conversion - `PPD`: prearranged payment and deposit entry -
            `TEL`: telephone-initiated entry - `WEB`: internet-initiated entry
        terminal_city (str): City in which the terminal is located. If more than four
            alphanumeric characters are submitted, the transaction will be declined.
            You cannot include any special characters.
        terminal_state (str): State in which the terminal is located. If more than
            two alphanumeric characters are submitted, the transaction will be
            declined.  You cannot include any special characters.
        effective_date (str): Effective date for the transaction. The effective date
            must be within 45 days of the current day. If you do not include this
            value, Visa Acceptance sets the effective date to the next business day.
            Format: `MMDDYYYY`  Supported only for the Visa Acceptance ACH Service.
        partial_payment_id (str): Identifier for a partial payment or partial credit.
            The value for each debit request or credit request must be unique within
            the scope of the order.
        settlement_method (str): Method used for settlement.  Possible values: - `A`:
            Automated Clearing House (default for credits and for transactions using
            Canadian dollars) - `F`: Facsimile draft (U.S. dollars only) - `B`: Best
            possible (U.S. dollars only) (default if the field has not already been
            configured for your merchant ID)
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "customer_memo": "customerMemo",
        "sec_code": "secCode",
        "terminal_city": "terminalCity",
        "terminal_state": "terminalState",
        "effective_date": "effectiveDate",
        "partial_payment_id": "partialPaymentId",
        "settlement_method": "settlementMethod",
    }

    _optionals = [
        "customer_memo",
        "sec_code",
        "terminal_city",
        "terminal_state",
        "effective_date",
        "partial_payment_id",
        "settlement_method",
    ]

    def __init__(
        self,
        customer_memo=APIHelper.SKIP,
        sec_code=APIHelper.SKIP,
        terminal_city=APIHelper.SKIP,
        terminal_state=APIHelper.SKIP,
        effective_date=APIHelper.SKIP,
        partial_payment_id=APIHelper.SKIP,
        settlement_method=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a BankTransferOptions2 instance."""
        # Initialize members of the class
        if customer_memo is not APIHelper.SKIP:
            self.customer_memo = customer_memo
        if sec_code is not APIHelper.SKIP:
            self.sec_code = sec_code
        if terminal_city is not APIHelper.SKIP:
            self.terminal_city = terminal_city
        if terminal_state is not APIHelper.SKIP:
            self.terminal_state = terminal_state
        if effective_date is not APIHelper.SKIP:
            self.effective_date = effective_date
        if partial_payment_id is not APIHelper.SKIP:
            self.partial_payment_id = partial_payment_id
        if settlement_method is not APIHelper.SKIP:
            self.settlement_method = settlement_method

        # 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
        customer_memo =\
            dictionary.get("customerMemo")\
            if dictionary.get("customerMemo")\
                else APIHelper.SKIP
        sec_code =\
            dictionary.get("secCode")\
            if dictionary.get("secCode")\
                else APIHelper.SKIP
        terminal_city =\
            dictionary.get("terminalCity")\
            if dictionary.get("terminalCity")\
                else APIHelper.SKIP
        terminal_state =\
            dictionary.get("terminalState")\
            if dictionary.get("terminalState")\
                else APIHelper.SKIP
        effective_date =\
            dictionary.get("effectiveDate")\
            if dictionary.get("effectiveDate")\
                else APIHelper.SKIP
        partial_payment_id =\
            dictionary.get("partialPaymentId")\
            if dictionary.get("partialPaymentId")\
                else APIHelper.SKIP
        settlement_method =\
            dictionary.get("settlementMethod")\
            if dictionary.get("settlementMethod")\
                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(customer_memo,
                   sec_code,
                   terminal_city,
                   terminal_state,
                   effective_date,
                   partial_payment_id,
                   settlement_method,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _customer_memo=(
            self.customer_memo
            if hasattr(self, "customer_memo")
            else None
        )
        _sec_code=(
            self.sec_code
            if hasattr(self, "sec_code")
            else None
        )
        _terminal_city=(
            self.terminal_city
            if hasattr(self, "terminal_city")
            else None
        )
        _terminal_state=(
            self.terminal_state
            if hasattr(self, "terminal_state")
            else None
        )
        _effective_date=(
            self.effective_date
            if hasattr(self, "effective_date")
            else None
        )
        _partial_payment_id=(
            self.partial_payment_id
            if hasattr(self, "partial_payment_id")
            else None
        )
        _settlement_method=(
            self.settlement_method
            if hasattr(self, "settlement_method")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"customer_memo={_customer_memo!r}, "
            f"sec_code={_sec_code!r}, "
            f"terminal_city={_terminal_city!r}, "
            f"terminal_state={_terminal_state!r}, "
            f"effective_date={_effective_date!r}, "
            f"partial_payment_id={_partial_payment_id!r}, "
            f"settlement_method={_settlement_method!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _customer_memo=(
            self.customer_memo
            if hasattr(self, "customer_memo")
            else None
        )
        _sec_code=(
            self.sec_code
            if hasattr(self, "sec_code")
            else None
        )
        _terminal_city=(
            self.terminal_city
            if hasattr(self, "terminal_city")
            else None
        )
        _terminal_state=(
            self.terminal_state
            if hasattr(self, "terminal_state")
            else None
        )
        _effective_date=(
            self.effective_date
            if hasattr(self, "effective_date")
            else None
        )
        _partial_payment_id=(
            self.partial_payment_id
            if hasattr(self, "partial_payment_id")
            else None
        )
        _settlement_method=(
            self.settlement_method
            if hasattr(self, "settlement_method")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"customer_memo={_customer_memo!s}, "
            f"sec_code={_sec_code!s}, "
            f"terminal_city={_terminal_city!s}, "
            f"terminal_state={_terminal_state!s}, "
            f"effective_date={_effective_date!s}, "
            f"partial_payment_id={_partial_payment_id!s}, "
            f"settlement_method={_settlement_method!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
