-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsynchronizer.py
More file actions
35 lines (25 loc) · 839 Bytes
/
synchronizer.py
File metadata and controls
35 lines (25 loc) · 839 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import abc
from typing import List
from mobync import ReadFilter
class Synchronizer(metaclass=abc.ABCMeta):
@abc.abstractmethod
def read(self, where: str, filters: List[ReadFilter]) -> str:
pass
@abc.abstractmethod
def update(self, where: str, data_json: str) -> None:
pass
@abc.abstractmethod
def validate_update(self, owner_id: str, **kwargs) -> bool:
pass
@abc.abstractmethod
def create(self, where: str, data_json: str) -> None: # todo: should receive dict?
pass
@abc.abstractmethod
def validate_create(self, owner_id: str, **kwargs) -> bool:
pass
@abc.abstractmethod
def delete(self, where: str, data_json: str) -> None:
pass
@abc.abstractmethod
def validate_delete(self, owner_id: str, **kwargs) -> bool:
pass