2024-04-15 02:16:07 +03:00
|
|
|
from abc import abstractmethod
|
|
|
|
from typing import Protocol
|
|
|
|
|
2024-04-15 04:02:47 +03:00
|
|
|
from protocols.models import KeyDTO
|
2024-04-15 02:16:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
class Repository(Protocol):
|
|
|
|
@abstractmethod
|
|
|
|
def get_key(self, obj: KeyDTO) -> KeyDTO | None:
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def add_key(self, obj: KeyDTO) -> KeyDTO:
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
@abstractmethod
|
|
|
|
def put_key(self, obj: KeyDTO) -> KeyDTO:
|
|
|
|
raise NotImplementedError
|