23 lines
566 B
Python
23 lines
566 B
Python
from abc import abstractmethod
|
|
from typing import Protocol
|
|
|
|
from flask_demo_api.protocols.models import KeyDTO
|
|
|
|
|
|
class Repository(Protocol):
|
|
@abstractmethod
|
|
def get_key(self, obj: KeyDTO) -> KeyDTO | None:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def add_key(self, obj: KeyDTO) -> KeyDTO | None:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def put_key(self, obj: KeyDTO) -> KeyDTO | None:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def delete_key(self, obj: KeyDTO) -> None:
|
|
raise NotImplementedError
|