33 lines
817 B
Python
33 lines
817 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Optional
|
|
|
|
from cpl_query.extension import List
|
|
|
|
from gismo_data.model.server import Server
|
|
|
|
|
|
class ServerRepositoryABC(ABC):
|
|
|
|
@abstractmethod
|
|
def __init__(self): pass
|
|
|
|
@abstractmethod
|
|
def get_servers(self) -> List[Server]: pass
|
|
|
|
@abstractmethod
|
|
def get_server_by_id(self, id: int) -> Server: pass
|
|
|
|
@abstractmethod
|
|
def get_server_by_discord_id(self, discord_id: int) -> Server: pass
|
|
|
|
@abstractmethod
|
|
def find_server_by_discord_id(self, discord_id: int) -> Optional[Server]: pass
|
|
|
|
@abstractmethod
|
|
def add_server(self, server: Server) -> int: pass
|
|
|
|
@abstractmethod
|
|
def update_server(self, server: Server): pass
|
|
|
|
@abstractmethod
|
|
def delete_server(self, server: Server): pass |