from logging import Logger

from interactor.route.menu.get_banners.dto import (
    GetBannersRequest,
    GetBannersResponse
)
from model.config import Config
from validation_util import validate_api_key


class GetBannersInteractor(object):

    def __init__(
            self,
            logger,   # type: Logger
            config    # type: Config
    ):
        # type: (...) -> None

        self.logger = logger
        self.config = config

    def execute(
            self,
            request   # type: GetBannersRequest
    ):
        # type: (...) -> GetBannersResponse

        validate_api_key(request, self.config.api_key_mapping)

        return GetBannersResponse(self.config.totem_config_path)
