from logging import Logger

from services.services import UpdateService


class BOHChangeNotificationConfigInteractor(object):
    def __init__(
        self,
        update_service,  # type: UpdateService
        logger,          # type: Logger
    ):
        # type: (...) -> None

        self.update_service = update_service
        self.logger = logger

    def process_request(
        self,
    ):
        # type: (...) -> None

        try:
            self.update_service.update_configured_alerts()
        except Exception:  # noqa
            self.logger.exception("Error updating configured alerts")
            raise
        else:
            self.update_service.update_configured_alerts_ack()


