-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.py
42 lines (31 loc) · 950 Bytes
/
base.py
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
36
37
38
39
40
41
42
from abc import ABC, abstractmethod
from typing import Iterable
from pydantic import BaseModel
class LiveInboxApiNiconicoUser(BaseModel):
remote_niconico_user_id: str
name: str
enabled: bool
icon_url: str | None
class LiveInboxApiNiconicoUserCreateObject(BaseModel):
remote_niconico_user_id: str
name: str
enabled: bool
icon_url: str | None
class LiveInboxApiNiconicoUserEnabledUpdateObject(BaseModel):
remote_niconico_user_id: str
enabled: bool
class LiveInboxApiNiconicoUserManager(ABC):
@abstractmethod
def get_all(
self,
) -> list[LiveInboxApiNiconicoUser]: ...
@abstractmethod
def create_users(
self,
create_objects: Iterable[LiveInboxApiNiconicoUserCreateObject],
) -> None: ...
@abstractmethod
def bulk_update_user_enabled(
self,
update_objects: Iterable[LiveInboxApiNiconicoUserEnabledUpdateObject],
) -> None: ...