-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdirect_message.go
113 lines (97 loc) · 4.42 KB
/
direct_message.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package gotwtr
type DMEventField string
const (
DirectMessageFieldID DMEventField = "id"
DirectMessageFieldText DMEventField = "text"
DirectMessageFieldEventType DMEventField = "event_type"
DirectMessageFieldCreatedAt DMEventField = "created_at"
DirectMessageFieldDMConversationID DMEventField = "dm_conversation_id"
DirectMessageFieldSenderID DMEventField = "sender_id"
DirectMessageFieldParticipantIDs DMEventField = "participant_ids"
DirectMessageFieldReferencedTweets DMEventField = "referenced_tweets"
DirectMessageFieldAttachments DMEventField = "attachments"
)
type EventTypes string
const (
EventTypesFieldMessageCreate EventTypes = "MessageCreate"
EventTypesFieldParticipantsJoin EventTypes = "ParticipantsJoin"
EventTypesFieldParticipantsLeave EventTypes = "ParticipantsLeave"
)
type DirectMessage struct {
Attachments []DirectMessageAttachment `json:"attachments,omitempty"`
CreatedAt string `json:"created_at"`
DMConversationID string `json:"dm_conversation_id"`
EventType string `json:"event_type"`
ID string `json:"id"`
SenderID string `json:"sender_id"`
Text string `json:"text,omitempty"`
}
type DirectMessageMeta struct {
ResultCount int `json:"result_count"`
PreviousToken string `json:"previous_token,omitempty"`
NextToken string `json:"next_token,omitempty"`
}
type DirectMessageAttachment struct {
MediaID string `json:"media_id"`
}
type CreateOneToOneDMBody struct {
Text string `json:"text,omitempty"`
Attachments []DirectMessageAttachment `json:"attachments,omitempty"`
}
type CreateOneToOneDMResponse struct {
DMConversationID string `json:"dm_conversation_id,omitempty"`
DMEventFieldID string `json:"dm_event_id,omitempty"`
Errors []*APIResponseError `json:"errors,omitempty"`
Title string `json:"title,omitempty"`
Detail string `json:"detail,omitempty"`
Type string `json:"type,omitempty"`
}
type CreateNewGroupDMBody struct {
Text string `json:"text,omitempty"`
Attachments []DirectMessageAttachment `json:"attachments,omitempty"`
}
type CreateNewGroupDMResponse struct {
DMConversationID string `json:"dm_conversation_id,omitempty"`
DMEventFieldID string `json:"dm_event_id,omitempty"`
Errors []*APIResponseError `json:"errors,omitempty"`
Title string `json:"title,omitempty"`
Detail string `json:"detail,omitempty"`
Type string `json:"type,omitempty"`
}
type PostDMBody struct {
ConversationType string `json:"conversation_type"`
Message *DirectMessage `json:"message"`
ParticipantIDs []string `json:"participant_id"`
}
type PostDMResponse struct {
DMConversationID string `json:"dm_conversation_id,omitempty"`
DMEventFieldID string `json:"dm_event_id,omitempty"`
Errors []*APIResponseError `json:"errors,omitempty"`
Title string `json:"title,omitempty"`
Detail string `json:"detail,omitempty"`
Type string `json:"type,omitempty"`
}
type LookUpAllOneToOneDMResponse struct {
Message []*DirectMessage `json:"data"`
Errors []*APIResponseError `json:"errors,omitempty"`
Meta *DirectMessageMeta `json:"meta,omitempty"`
Title string `json:"title,omitempty"`
Detail string `json:"detail,omitempty"`
Type string `json:"type,omitempty"`
}
type LookUpDMResponse struct {
Message []*DirectMessage `json:"data"`
Errors []*APIResponseError `json:"errors,omitempty"`
Meta *DirectMessageMeta `json:"meta,omitempty"`
Title string `json:"title,omitempty"`
Detail string `json:"detail,omitempty"`
Type string `json:"type,omitempty"`
}
type LookUpAllDMResponse struct {
Message []*DirectMessage `json:"data"`
Errors []*APIResponseError `json:"errors,omitempty"`
Meta *DirectMessageMeta `json:"meta,omitempty"`
Title string `json:"title,omitempty"`
Detail string `json:"detail,omitempty"`
Type string `json:"type,omitempty"`
}