-
Notifications
You must be signed in to change notification settings - Fork 1
/
api_requests.py
60 lines (43 loc) · 1.14 KB
/
api_requests.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from typing import Union
from pydantic import BaseModel
class Msg(BaseModel):
areas: Union[list[str], None]
title: Union[str, None]
categories: Union[list[str], None]
class GetGroupsRequest(Msg):
offset: int = 0
page_size: int = 50
class GetDistinctRequest(BaseModel):
field: str
class LoginItem(BaseModel):
username: str
password: str
class AdminAcessRequest(BaseModel):
token: str
class FetchPendingGroupRequest(AdminAcessRequest):
pass
class AddPendingGroupRequest(BaseModel):
group_name: str
group_link: str
area: str
category: str
description: Union[str, None]
class AddPendingGroupResponse(BaseModel):
success: bool
class ResponsePendingGroupResponse(BaseModel):
success: bool
class PendingGroupResponseRequest(AdminAcessRequest):
group_id: str
approve: bool
class DeleteGroupRequest(AdminAcessRequest):
group_id: str
class DeleteGroupResponse(BaseModel):
success: bool
class UpdateGroupRequest(AdminAcessRequest):
group_id: str
group_name: str
group_link: str
area: str
category: str
class UpdateGroupResponse(BaseModel):
success: bool