from typing import Final

from gateway_transport.dbus.DbusClient import DbusClient


class LogindManagerClient(DbusClient):
    SERVICE: Final[str] = "org.freedesktop.login1"
    PATH: Final[str] = "/org/freedesktop/login1"
    IFACE: Final[str] = "org.freedesktop.login1.Manager"

    def __init__(self, *, opTimeout: float = 5.0) -> None:
        super().__init__(
            service=self.SERVICE,
            path=self.PATH,
            interface=self.IFACE,
            opTimeout=opTimeout,
        )

    async def reboot(self, *, interactive: bool = False) -> None:
        await self.callMethod("Reboot", interactive)
