from typing import (
    Optional,
    Dict
)

from application.service import ChromeUpdaterService

from update_api.dto import ChromeUpdaterDto


class ChromeUpdaterInteractor(object):
    def __init__(
        self,
        chrome_updater_service  # type: ChromeUpdaterService
    ):
        # type: (...) -> None

        self.chrome_updater_service = chrome_updater_service

    def update_chrome(
        self,           # type: ChromeUpdaterInteractor
        validate,       # type: bool
        data=None,      # type: Optional[ChromeUpdaterDto]
    ):
        # type: (...) -> str

        return self.chrome_updater_service.update_chrome(
            validate_version=validate,
            restart_hv=True,
            data=data,
        )
