"""visaacceptancemergedspec.

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

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


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

    Attributes:
        session_type (str): Will have 2 values, 'U' (Update) , 'N' (New). Any other
            values will be rejected. Default will be 'N'
        payment_flow_mode (str): Whether merchant wants to pass the flow Inline or
            want to invoke Klarna Hosted Page
        action_list (List[str]): Possible values are one or more of follows:   -
            `AP_SESSIONS`: Use this when Alternative Payment Sessions service is
            requested.
        additional_properties (Dict[str, Any]): The additional properties for the
            model.

    """

    # Create a mapping from Model property names to API property names
    _names = {
        "session_type": "sessionType",
        "payment_flow_mode": "paymentFlowMode",
        "action_list": "actionList",
    }

    _optionals = [
        "session_type",
        "payment_flow_mode",
        "action_list",
    ]

    def __init__(
        self,
        session_type=APIHelper.SKIP,
        payment_flow_mode=APIHelper.SKIP,
        action_list=APIHelper.SKIP,
        additional_properties=None):
        """Initialize a ProcessingInformation23 instance."""
        # Initialize members of the class
        if session_type is not APIHelper.SKIP:
            self.session_type = session_type
        if payment_flow_mode is not APIHelper.SKIP:
            self.payment_flow_mode = payment_flow_mode
        if action_list is not APIHelper.SKIP:
            self.action_list = action_list

        # 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
        session_type =\
            dictionary.get("sessionType")\
            if dictionary.get("sessionType")\
                else APIHelper.SKIP
        payment_flow_mode =\
            dictionary.get("paymentFlowMode")\
            if dictionary.get("paymentFlowMode")\
                else APIHelper.SKIP
        action_list =\
            dictionary.get("actionList")\
            if dictionary.get("actionList")\
                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(session_type,
                   payment_flow_mode,
                   action_list,
                   additional_properties)

    def __repr__(self):
        """Return a unambiguous string representation."""
        _session_type=(
            self.session_type
            if hasattr(self, "session_type")
            else None
        )
        _payment_flow_mode=(
            self.payment_flow_mode
            if hasattr(self, "payment_flow_mode")
            else None
        )
        _action_list=(
            self.action_list
            if hasattr(self, "action_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"session_type={_session_type!r}, "
            f"payment_flow_mode={_payment_flow_mode!r}, "
            f"action_list={_action_list!r}, "
            f"additional_properties={_additional_properties!r}, "
            f")"
        )

    def __str__(self):
        """Return a human-readable string representation."""
        _session_type=(
            self.session_type
            if hasattr(self, "session_type")
            else None
        )
        _payment_flow_mode=(
            self.payment_flow_mode
            if hasattr(self, "payment_flow_mode")
            else None
        )
        _action_list=(
            self.action_list
            if hasattr(self, "action_list")
            else None
        )
        _additional_properties=self.additional_properties
        return (
            f"{self.__class__.__name__}("
            f"session_type={_session_type!s}, "
            f"payment_flow_mode={_payment_flow_mode!s}, "
            f"action_list={_action_list!s}, "
            f"additional_properties={_additional_properties!s}, "
            f")"
        )
