"""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.authorization_options_2 import (
    AuthorizationOptions2,
)
from visaacceptancemergedspec.models.bank_transfer_options_1 import (
    BankTransferOptions1,
)
from visaacceptancemergedspec.models.capture_options_1 import (
    CaptureOptions1,
)
from visaacceptancemergedspec.models.purchase_options_1 import (
    PurchaseOptions1,
)


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

    Attributes:
        bank_transfer_options (BankTransferOptions1): The model property of type
            BankTransferOptions1.
        payment_solution (str): Type of digital payment solution for the transaction.
            Possible Values:   - `visacheckout`: Visa Checkout. This value is
            required for Visa Checkout transactions. For details, see
            `payment_solution` field description in [Visa Checkout Using the REST
            API.](  - `001`: Apple Pay.  - `004`: Visa Acceptance In-App Solution.  -
            `005`: Masterpass. This value is required for Masterpass transactions on
            OmniPay Direct.   - `006`: Android Pay.  - `007`: Chase Pay.  - `008`:
            Samsung Pay.  - `012`: Google Pay.  - `013`: Visa Acceptance P2PE
            Decryption  - `014`: Mastercard credential on file (COF) payment network
            token. Returned in authorizations that use a payment network token
            associated with a TMS token.  - `015`: Visa credential on file (COF)
            payment network token. Returned in authorizations that use a payment
            network token associated with a TMS token.  - `027`: Click to Pay.
        enhanced_data_enabled (bool): The possible values for the reply field are: -
            `true` : the airline data was included in the request to the processor. -
            `false` : the airline data was not included in the request to the
            processor.  Returned by authorization, capture, or credit services.
        capture_options (CaptureOptions1): The model property of type CaptureOptions1.
        authorization_options (AuthorizationOptions2): The model property of type
            AuthorizationOptions2.
        purchase_options (PurchaseOptions1): The model property of type
            PurchaseOptions1.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "bank_transfer_options": "bankTransferOptions",
        "payment_solution": "paymentSolution",
        "enhanced_data_enabled": "enhancedDataEnabled",
        "capture_options": "captureOptions",
        "authorization_options": "authorizationOptions",
        "purchase_options": "purchaseOptions",
    }

    _optionals = [
        "bank_transfer_options",
        "payment_solution",
        "enhanced_data_enabled",
        "capture_options",
        "authorization_options",
        "purchase_options",
    ]

    def __init__(
        self,
        bank_transfer_options=APIHelper.SKIP,
        payment_solution=APIHelper.SKIP,
        enhanced_data_enabled=APIHelper.SKIP,
        capture_options=APIHelper.SKIP,
        authorization_options=APIHelper.SKIP,
        purchase_options=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessingInformation1 instance."""
        # Initialize members of the class
        if bank_transfer_options is not APIHelper.SKIP:
            self.bank_transfer_options = bank_transfer_options
        if payment_solution is not APIHelper.SKIP:
            self.payment_solution = payment_solution
        if enhanced_data_enabled is not APIHelper.SKIP:
            self.enhanced_data_enabled = enhanced_data_enabled
        if capture_options is not APIHelper.SKIP:
            self.capture_options = capture_options
        if authorization_options is not APIHelper.SKIP:
            self.authorization_options = authorization_options
        if purchase_options is not APIHelper.SKIP:
            self.purchase_options = purchase_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
        bank_transfer_options =\
            BankTransferOptions1.from_dictionary(
                dictionary.get("bankTransferOptions"))\
                if "bankTransferOptions" in dictionary.keys()\
                else APIHelper.SKIP
        payment_solution =\
            dictionary.get("paymentSolution")\
            if dictionary.get("paymentSolution")\
                else APIHelper.SKIP
        enhanced_data_enabled =\
            dictionary.get("enhancedDataEnabled")\
            if "enhancedDataEnabled" in dictionary.keys()\
                else APIHelper.SKIP
        capture_options =\
            CaptureOptions1.from_dictionary(
                dictionary.get("captureOptions"))\
                if "captureOptions" in dictionary.keys()\
                else APIHelper.SKIP
        authorization_options =\
            AuthorizationOptions2.from_dictionary(
                dictionary.get("authorizationOptions"))\
                if "authorizationOptions" in dictionary.keys()\
                else APIHelper.SKIP
        purchase_options =\
            PurchaseOptions1.from_dictionary(
                dictionary.get("purchaseOptions"))\
                if "purchaseOptions" 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(bank_transfer_options,
                   payment_solution,
                   enhanced_data_enabled,
                   capture_options,
                   authorization_options,
                   purchase_options,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _bank_transfer_options=(
            self.bank_transfer_options
            if hasattr(self, "bank_transfer_options")
            else None
        )
        _payment_solution=(
            self.payment_solution
            if hasattr(self, "payment_solution")
            else None
        )
        _enhanced_data_enabled=(
            self.enhanced_data_enabled
            if hasattr(self, "enhanced_data_enabled")
            else None
        )
        _capture_options=(
            self.capture_options
            if hasattr(self, "capture_options")
            else None
        )
        _authorization_options=(
            self.authorization_options
            if hasattr(self, "authorization_options")
            else None
        )
        _purchase_options=(
            self.purchase_options
            if hasattr(self, "purchase_options")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"bank_transfer_options={_bank_transfer_options!r}, "
            f"payment_solution={_payment_solution!r}, "
            f"enhanced_data_enabled={_enhanced_data_enabled!r}, "
            f"capture_options={_capture_options!r}, "
            f"authorization_options={_authorization_options!r}, "
            f"purchase_options={_purchase_options!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _bank_transfer_options=(
            self.bank_transfer_options
            if hasattr(self, "bank_transfer_options")
            else None
        )
        _payment_solution=(
            self.payment_solution
            if hasattr(self, "payment_solution")
            else None
        )
        _enhanced_data_enabled=(
            self.enhanced_data_enabled
            if hasattr(self, "enhanced_data_enabled")
            else None
        )
        _capture_options=(
            self.capture_options
            if hasattr(self, "capture_options")
            else None
        )
        _authorization_options=(
            self.authorization_options
            if hasattr(self, "authorization_options")
            else None
        )
        _purchase_options=(
            self.purchase_options
            if hasattr(self, "purchase_options")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"bank_transfer_options={_bank_transfer_options!s}, "
            f"payment_solution={_payment_solution!s}, "
            f"enhanced_data_enabled={_enhanced_data_enabled!s}, "
            f"capture_options={_capture_options!s}, "
            f"authorization_options={_authorization_options!s}, "
            f"purchase_options={_purchase_options!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
