from abc import ABC, abstractmethod
from typing import Callable

from gateway_core.domain.Reboot import RebootDto
from gateway_core.domain.SoftwareUpgrade import SoftwareUpgradeStatus, SoftwareUpgradeDto
from gateway_core.domain.SystemInfoData import SystemInfoDto
from gateway_transport.http.FileTransferClient import TransferStatusDto

class NotificationPort(ABC):

    @abstractmethod
    async def notifySystemInfo(self, systemInfo: SystemInfoDto) -> None:
        """Notify about a system info."""
        raise NotImplementedError

    @abstractmethod
    async def notifySoftwareUpgradeStatus(self, dto: SoftwareUpgradeDto, status: SoftwareUpgradeStatus) -> None:
        """Notify that a software update is now running."""
        raise NotImplementedError

    @abstractmethod
    async def notifyFileList(self, taskId: str, fileList: list[str]) -> None:
        """Notify about a file list."""
        raise NotImplementedError

    @abstractmethod
    async def notifyLogFileUpload(self, taskId: str, getStatus: Callable) -> None:
        """Notify about a file list."""
        raise NotImplementedError

    @abstractmethod
    async def notifyConfigFileUpload(self, taskId: str, getStatus: Callable) -> None:
        """Notify about a file upload."""
        raise NotImplementedError

    @abstractmethod
    async def notifyConfigFileDownload(self, taskId: str, getStatus: Callable[[], TransferStatusDto]) -> None:
        """Notify about the config file download."""
        raise NotImplementedError

    @abstractmethod
    async def notifyUpgradeProgress(self, taskId: str, status: str, progress: int) -> None:
        """Notify about the config upgrade progress."""
        raise NotImplementedError

    @abstractmethod
    async def notifyRebootStatus(self, dto: RebootDto, status: str) -> None:
        """Notify about a reboot status."""
        raise NotImplementedError