flask-demo-api/flask_demo_api/protocols/repository.py

19 lines
450 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:
raise NotImplementedError
@abstractmethod
def put_key(self, obj: KeyDTO) -> KeyDTO:
raise NotImplementedError