~thrrgilag/woodstock

woodstock/objects.go -rw-r--r-- 7.9 KiB
62b10b5cMorgan McMillian Update for new project location and module name 3 months ago
                                                                                
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
package woodstock

// Image object definition
type Image struct {
	Link      string `json:"link"`
	IsDefault bool   `json:"is_default"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
}

// ContentOfUser object definition
type ContentOfUser struct {
	Text        string   `json:"text"`
	HTML        string   `json:"html"`
	Entities    Entities `json:"entities"`
	AvatarImage Image    `json:"avatar_image"`
	CoverImage  Image    `json:"cover_image"`
}

// CountsOfUser object definition
type CountsOfUser struct {
	Bookmarks int `json:"bookmarks"`
	Clients   int `json:"clients"`
	Followers int `json:"followers"`
	Following int `json:"following"`
	Posts     int `json:"posts"`
	Users     int `json:"users"`
}

// Verified object definition
type Verified struct {
	Domain string `json:"domain"`
	Link   string `json:"link"`
}

// User object definition
type User struct {
	CreatedAt    string        `json:"created_at"`
	GUID         string        `json:"guid"`
	ID           string        `json:"id"`
	Locale       string        `json:"locale"`
	Timezone     string        `json:"timezon"`
	Type         string        `json:"type"`
	Username     string        `json:"username"`
	Name         string        `json:"name"`
	Content      ContentOfUser `json:"content"`
	Counts       CountsOfUser  `json:"counts"`
	FollowsYou   bool          `json:"follows_you"`
	YouBlocked   bool          `json:"you_blocked"`
	YouFollow    bool          `json:"you_follow"`
	YouMuted     bool          `json:"you_muted"`
	YouCanFollow bool          `json:"you_can_follow"`
	Verified     Verified      `json:"verified"`
}

// Source object definition
type Source struct {
	Name string `json:"name"`
	Link string `json:"link"`
	ID   string `json:"id"`
}

// CountsOfPost object definition
type CountsOfPost struct {
	Bookmarks int `json:"bookmarks"`
	Replies   int `json:"replies"`
	Reposts   int `json:"reposts"`
	Threads   int `json:"threads"`
}

// ContentOfPost object definition
type ContentOfPost struct {
	Text           string   `json:"text"`
	HTML           string   `json:"html"`
	Entities       Entities `json:"entities"`
	LinksNotParsed bool     `json:"links_not_parsed"`
}

// Post object definition
type Post struct {
	CreatedAt     string        `json:"created_at"`
	GUID          string        `json:"guid"`
	ID            string        `json:"id"`
	IsDeleted     bool          `json:"is_deleted"`
	Source        Source        `json:"source"`
	User          User          `json:"user"`
	ThreadID      string        `json:"thread_id"`
	IsRevised     bool          `json:"is_revised"`
	Revision      string        `json:"revision"`
	ReplyTo       string        `json:"reply_to"`
	RepostOf      *Post         `json:"repost_of"`
	Counts        CountsOfPost  `json:"counts"`
	Content       ContentOfPost `json:"content"`
	YouBookmarked bool          `json:"you_bookmarked"`
	YouReposted   bool          `json:"you_reposted"`
	PaginationID  string        `json:"pagination_id"`
}

// Action object definition
type Action struct {
	PaginationID string `json:"pagination_id"`
	EventDate    string `json:"event_date"`
	Action       string `json:"action"`
	Users        []User `json:"users"`
	Objects      []Post `json:"objects"`
}

// Presence object definition
type Presence struct {
	ID         string `json:"id"`
	LastSeenAt string `json:"last_seen_at"`
	Presence   string `json:"presence"`
}

// Full object definition
type Full struct {
	Immutable bool     `json:"immutable"`
	You       bool     `json:"you"`
	UserIds   []string `json:"user_ids"`
}

// Write object definition
type Write struct {
	*Full
	AnyUser bool `json:"any_user"`
}

// Read object definition
type Read struct {
	*Write
	Public bool `json:"publicj"`
}

// ACL object definition
type ACL struct {
	Full  Full  `json:"full"`
	Write Write `json:"write"`
	Read  Read  `json:"read"`
}

// CountsOfChannel object definition
type CountsOfChannel struct {
	Messages    int `json:"messages"`
	Subscribers int `json:"subscribers"`
}

// Channel object definition
type Channel struct {
	CreatedAt     string          `json:"created_at"`
	ID            string          `json:"id"`
	Type          string          `json:"type"`
	Owner         User            `json:"owner"`
	ACL           ACL             `json:"acl"`
	Counts        CountsOfChannel `json:"counts"`
	YouSubscribed bool            `json:"you_subscribed"`
	YouMuted      bool            `json:"you_muted"`
	HasUnread     bool            `json:"has_unread"`
	PaginationID  string          `json:"pagination_id"`
}

// CountsOfMessage object definition
type CountsOfMessage struct {
	Replies int `json:"replies"`
}

// ContentOfMessage object definition
type ContentOfMessage struct {
	HTML     string   `json:"html"`
	Text     string   `json:"text"`
	Entities Entities `json:"entities"`
}

// Message object definition
type Message struct {
	ID           string           `json:"id"`
	ChannelID    string           `json:"channel_id"`
	CreatedAt    string           `json:"created_at"`
	Source       Source           `json:"source"`
	IsDeleted    bool             `json:"is_deleted"`
	IsSticky     bool             `json:"is_sticky"`
	ReplyTo      string           `json:"reply_to"`
	ThreadID     string           `json:"thread_id"`
	User         User             `json:"user"`
	Counts       CountsOfMessage  `json:"counts"`
	Content      ContentOfMessage `json:"content"`
	PaginationID string           `json:"pagination_id"`
}

// AudioInfo object definition
type AudioInfo struct {
	Duration       int    `json:"duration"`
	DurationString string `json:"duration_string"`
	Bitrate        int    `json:"bitrate"`
}

// VideoInfo object definition
type VideoInfo struct {
	Duration       int    `json:"duration"`
	DurationString string `json:"duration_string"`
	Bitrate        int    `json:"bitrate"`
	Height         int    `json:"height"`
	Width          int    `json:"width"`
}

// UploadParameters object definition
type UploadParameters struct {
	Method string `json:"method"`
	Url    string `json:"url"`
}

// File object definition
type File struct {
	AudioInfo        AudioInfo        `json:"audio_info"`
	CreatedAt        string           `json:"created_at"`
	FileToken        string           `json:"file_token"`
	FileTokenRead    string           `json:"file_token_read"`
	ID               string           `json:"id"`
	ImageInfo        Image            `json:"image_info"`
	IsComplete       bool             `json:"is_complete"`
	IsPublic         bool             `json:"is_public"`
	Kind             string           `json:"kind"`
	Link             string           `json:"link"`
	LinkExpiresAt    string           `json:"link_expires_at"`
	LinkShort        string           `json:"link_short"`
	MimeType         string           `json:"mime_type"`
	Name             string           `json:"name"`
	Sha256           string           `json:"sha256"`
	Size             int              `json:"size"`
	Source           Source           `json:"source"`
	Type             string           `json:"type"`
	UploadParameters UploadParameters `json:"upload_parameters"`
	User             User             `json:"user"`
	VideoInfo        VideoInfo        `json:"video_info"`
}

// ContentOfClient object definition
type ContentOfClient struct {
	*ContentOfMessage
}

// ClientInfo object definition
type ClientInfo struct {
	CreatedAt string          `json:"created_at"`
	CreatedBy User            `json:"created_by"`
	ID        string          `json:"id"`
	Link      string          `json:"link"`
	Name      string          `json:"name"`
	Posts     int             `json:"posts"`
	Content   ContentOfClient `json:"content"`
}

// Marker object definition
type Marker struct {
	ID         string `json:"id"`
	LastReadID string `json:"last_read_id"`
	Percentage int    `json:"percentage"`
	UpdatedAt  string `json:"updated_at"`
	Version    string `json:"version"`
	Name       string `json:"name"`
}

// Raw object definition
type Raw struct {
	Type  string      `json:"type"`
	Value interface{} `json:"value"`
}