inspected
This commit is contained in:
36
validators/chat.py
Normal file
36
validators/chat.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from typing import TypedDict, Optional, List
|
||||
|
||||
from validators.member import ChatMember
|
||||
from validators.message import Message
|
||||
|
||||
|
||||
class Chat(TypedDict):
|
||||
id: str
|
||||
members: List[int]
|
||||
admins: List[int]
|
||||
title: str
|
||||
updatedAt: Optional[int]
|
||||
createdAt: int
|
||||
createdBy: int
|
||||
description: Optional[str]
|
||||
|
||||
|
||||
class ChatPayload(TypedDict):
|
||||
id: str
|
||||
members: List[int | ChatMember]
|
||||
admins: List[int]
|
||||
title: str
|
||||
updatedAt: Optional[int]
|
||||
createdAt: int
|
||||
createdBy: int
|
||||
description: Optional[str]
|
||||
messages: Optional[List[Message]]
|
||||
unread: Optional[int]
|
||||
|
||||
|
||||
class ChatUpdate(TypedDict):
|
||||
id: str
|
||||
members: List[int]
|
||||
admins: List[int]
|
||||
title: str
|
||||
description: Optional[str]
|
@@ -1,32 +0,0 @@
|
||||
from typing import TypedDict, Optional, List
|
||||
|
||||
|
||||
class Message(TypedDict):
|
||||
id: int
|
||||
chat: str
|
||||
author: int
|
||||
body: str
|
||||
createdAt: int
|
||||
replyTo: Optional[int]
|
||||
createdAt: int
|
||||
updatedAt: Optional[int]
|
||||
|
||||
|
||||
class Chat(TypedDict):
|
||||
id: str
|
||||
members: List[int]
|
||||
admins: List[int]
|
||||
title: str
|
||||
updatedAt: Optional[int]
|
||||
createdAt: int
|
||||
createdBy: int
|
||||
description: Optional[str]
|
||||
|
||||
|
||||
class ChatMember(TypedDict):
|
||||
id: int
|
||||
slug: str
|
||||
name: str
|
||||
userpic: Optional[str]
|
||||
lastSeen: int
|
||||
online: Optional[bool]
|
10
validators/member.py
Normal file
10
validators/member.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import TypedDict, Optional
|
||||
|
||||
|
||||
class ChatMember(TypedDict):
|
||||
id: int
|
||||
slug: str
|
||||
name: str
|
||||
userpic: Optional[str]
|
||||
lastSeen: int
|
||||
online: Optional[bool]
|
12
validators/message.py
Normal file
12
validators/message.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from typing import TypedDict, Optional
|
||||
|
||||
|
||||
class Message(TypedDict):
|
||||
id: int
|
||||
chat: str
|
||||
author: int
|
||||
body: str
|
||||
createdAt: int
|
||||
replyTo: Optional[int]
|
||||
createdAt: int
|
||||
updatedAt: Optional[int]
|
Reference in New Issue
Block a user