-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathappeals.go
72 lines (60 loc) · 2 KB
/
appeals.go
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
61
62
63
64
65
66
67
68
69
70
71
72
package commentapi
// AppealBlockListArgs arguments
type AppealBlockListArgs struct {
Authorization
}
// AppealBlockListResponse response
type AppealBlockListResponse struct {
Blocks []Appeal `json:"blocks"`
}
// AppealListArgs arguments
type AppealListArgs struct {
ModAuthorization
}
// AppealListResponse response
type AppealListResponse struct {
Appeals []Appeal `json:"appeals"`
ModeratedAppeals []Appeal `json:"moderated_appeals"`
}
// AppealStatus status of appeal
type AppealStatus int
const (
// AppealPending the default value for all appeals
AppealPending AppealStatus = iota
// AppealEscalated appeal is escalated to shared block list owner
AppealEscalated
// AppealAccepted creator who blocked, has accepted the appeal
AppealAccepted
// AppealRejected creator who blocked, has rejected the appeal
AppealRejected
)
// AppealRequest appeal request
type AppealRequest struct {
AppealMessage string `json:"appeal_message"`
ResponseMessage string `json:"response_message"`
AppealStatus AppealStatus `json:"status"`
TxID string `json:"tx_id,omitempty"`
}
// Appeal structure for an appeal
type Appeal struct {
BlockedList SharedBlockedList `json:"blocked_list,omitempty"`
BlockedChannel BlockedChannel `json:"blocked_channel"`
AppealRequest AppealRequest `json:"appeal_request,omitempty"`
}
// AppealFileArgs arguments
type AppealFileArgs struct {
Authorization
SharedBlockedListID uint64 `json:"blocked_list_id"`
BlockedByChannelID string `json:"blocked_by_channel_id"`
BlockedByChannelName string `json:"blocked_by_channel_name"`
AppealMessage string `json:"appeal_message"`
TxID string `json:"tx_id,omitempty"`
}
// AppealCloseArgs arguments
type AppealCloseArgs struct {
Authorization
BlockedChannelID string `json:"blocked_channel_id"`
BlockedChannelName string `json:"blocked_channel_name"`
AppealStatus AppealStatus `json:"status"`
ResponseMessage string `json:"response_message"`
}