from typing import Any

from messagebus import (
    AckMessage,
    Event,
    Message,
    MessageBus,
    NakMessage,
)
from messageprocessorutil import UuidMessageProcessor

from services.interactor import BOHChangeNotificationConfigInteractor


class BOHChangeNotificationConfigProcessor(UuidMessageProcessor):
    def __init__(
        self,
        boh_change_notification_config_interactor,  # type: BOHChangeNotificationConfigInteractor
    ):
        # type: (...) -> None

        super(BOHChangeNotificationConfigProcessor, self).__init__()
        self.boh_change_notification_config_interactor = boh_change_notification_config_interactor

    def parse_data(
        self,
        data,           # type: str
        event_type,     # type: str
    ):
        # type: (...) -> None

        return None

    def call_business(
        self,
        request,    # type: None
    ):
        # type: (...) -> str

        return self.boh_change_notification_config_interactor.process_request()

    def format_response(
        self,
        message_bus,    # type: MessageBus
        message,        # type: Message
        event,          # type: Event
        request,        # type: None
        result,         # type: None
    ):
        # type: (...) -> None

        return self._do_not_reply_to_asynchronous_event()

    def format_exception(
        self,
        message_bus,    # type: MessageBus
        message,        # type: Message
        event,          # type: Event
        input_obj,      # type: None
        exception,      # type: Exception
    ):
        # type: (...) -> None

        return self._do_not_reply_to_asynchronous_event()

    def format_parse_exception(
        self,
        message_bus,    # type: MessageBus
        message,        # type: Message
        event,          # type: Event
        data,           # type: Any
        exception,      # type: Exception
    ):
        # type: (...) -> None

        return self._do_not_reply_to_asynchronous_event()

    @staticmethod
    def _do_not_reply_to_asynchronous_event():
        return None
