from typing import Any
from abc import ABCMeta, abstractmethod
from messagebus import Message, Event
from ._FlaskEventType import FlaskEventType
from flask import Request


class FlaskAdapter(object):
    __metaclass__ = ABCMeta

    @abstractmethod
    def get_type(self, path, request):
        # type: (str, Request) -> FlaskEventType
        raise NotImplementedError()

    @abstractmethod
    def create_message(self, path, request):
        # type: (str, Request) -> Message
        raise NotImplementedError()

    @abstractmethod
    def create_event(self, path, request):
        # type: (str, Request) -> Event
        raise NotImplementedError()

    @abstractmethod
    def create_reply(self, path, request, message):
        # type: (str, Request, Message) -> Any
        raise NotImplementedError()
