from abc import ABC, abstractmethod
from typing import Generic, TypeVar

from clochette.domain.entity.CalendarID import CalendarID
from clochette.domain.entity.ICredentialCalendar import ICredentialCalendar

_T = TypeVar("_T", bound="ICredentialCalendar")


class IKeyringService(ABC, Generic[_T]):
    @abstractmethod
    def store_auth(self, calendar_id: CalendarID, auth: _T) -> None:
        pass

    @abstractmethod
    def retrieve_auth(self, calendar_id: CalendarID) -> _T | None:
        pass
