Skip to content

Commit 4523c8a

Browse files
committed
move lists api to separate class
1 parent 82285d8 commit 4523c8a

File tree

4 files changed

+459
-407
lines changed

4 files changed

+459
-407
lines changed

automated_api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
ServerAPI,
3535
_PLACEHOLDER,
3636
_ActionsAPI,
37+
_ListsAPI,
3738
)
3839
from ayon_api.utils import NOT_SET # noqa: E402
3940

@@ -294,6 +295,7 @@ def prepare_api_functions(api_globals):
294295
functions = []
295296
_items = list(ServerAPI.__dict__.items())
296297
_items.extend(_ActionsAPI.__dict__.items())
298+
_items.extend(_ListsAPI.__dict__.items())
297299
for attr_name, attr in _items:
298300
if (
299301
attr_name.startswith("_")

ayon_api/_base.py

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,46 @@
1+
import typing
2+
from typing import Set
3+
4+
if typing.TYPE_CHECKING:
5+
from .typing import AnyEntityDict
6+
7+
18
class _BaseServerAPI:
9+
def get(self, entrypoint: str, **kwargs):
10+
raise NotImplementedError()
11+
12+
def post(self, entrypoint: str, **kwargs):
13+
raise NotImplementedError()
14+
15+
def put(self, entrypoint: str, **kwargs):
16+
raise NotImplementedError()
17+
18+
def patch(self, entrypoint: str, **kwargs):
19+
raise NotImplementedError()
20+
21+
def delete(self, entrypoint: str, **kwargs):
22+
raise NotImplementedError()
23+
24+
def raw_get(self, entrypoint: str, **kwargs):
25+
raise NotImplementedError()
26+
27+
def raw_post(self, entrypoint: str, **kwargs):
28+
raise NotImplementedError()
29+
30+
def raw_put(self, entrypoint: str, **kwargs):
31+
raise NotImplementedError()
32+
33+
def raw_patch(self, entrypoint: str, **kwargs):
34+
raise NotImplementedError()
35+
36+
def raw_delete(self, entrypoint: str, **kwargs):
37+
raise NotImplementedError()
38+
239
def get_default_settings_variant(self) -> str:
340
raise NotImplementedError()
441

5-
def get(self, entrypoint: str, **kwargs):
6-
pass
42+
def get_default_fields_for_type(self, entity_type: str) -> Set[str]:
43+
raise NotImplementedError()
744

8-
def post(self, entrypoint: str, **kwargs):
9-
pass
45+
def _convert_entity_data(self, entity: "AnyEntityDict"):
46+
raise NotImplementedError()

0 commit comments

Comments
 (0)