A Pointer Allows The Roundtrip To Omit A Field
Joe Fitzgerald
8 years ago
45 | 45 | Purpose ChannelPurpose `json:"purpose"` |
46 | 46 | IsMember bool `json:"is_member"` |
47 | 47 | LastRead string `json:"last_read,omitempty"` |
48 | Latest Message `json:"latest,omitempty"` | |
48 | Latest *Message `json:"latest,omitempty"` | |
49 | 49 | UnreadCount int `json:"unread_count,omitempty"` |
50 | 50 | NumMembers int `json:"num_members,omitempty"` |
51 | 51 | UnreadCountDisplay int `json:"unread_count_display,omitempty"` |
19 | 19 | Topic ChannelTopic `json:"topic"` |
20 | 20 | Purpose ChannelPurpose `json:"purpose"` |
21 | 21 | LastRead string `json:"last_read,omitempty"` |
22 | Latest Message `json:"latest,omitempty"` | |
22 | Latest *Message `json:"latest,omitempty"` | |
23 | 23 | UnreadCount int `json:"unread_count,omitempty"` |
24 | 24 | NumMembers int `json:"num_members,omitempty"` |
25 | 25 | UnreadCountDisplay int `json:"unread_count_display,omitempty"` |
144 | 144 | // Info contains various details about Users, Channels, Bots and the authenticated user |
145 | 145 | // It is returned by StartRTM |
146 | 146 | type Info struct { |
147 | Url string `json:"url,omitempty"` | |
148 | User UserDetails `json:"self,omitempty"` | |
149 | Team Team `json:"team,omitempty"` | |
150 | Users []User `json:"users,omitempty"` | |
151 | Channels []Channel `json:"channels,omitempty"` | |
152 | Groups []Group `json:"groups,omitempty"` | |
153 | Bots []Bot `json:"bots,omitempty"` | |
154 | IMs []IM `json:"ims,omitempty"` | |
147 | Url string `json:"url,omitempty"` | |
148 | User *UserDetails `json:"self,omitempty"` | |
149 | Team *Team `json:"team,omitempty"` | |
150 | Users []User `json:"users,omitempty"` | |
151 | Channels []Channel `json:"channels,omitempty"` | |
152 | Groups []Group `json:"groups,omitempty"` | |
153 | Bots []Bot `json:"bots,omitempty"` | |
154 | IMs []IM `json:"ims,omitempty"` | |
155 | 155 | } |
156 | 156 | |
157 | 157 | type infoResponseFull struct { |
9 | 9 | // Message is an auxiliary type to allow us to have a message containing sub messages |
10 | 10 | type Message struct { |
11 | 11 | Msg |
12 | SubMessage Msg `json:"message,omitempty"` | |
12 | SubMessage *Msg `json:"message,omitempty"` | |
13 | 13 | } |
14 | 14 | |
15 | 15 | // Msg contains information about a slack message |
22 | 22 | Timestamp string `json:"ts,omitempty"` |
23 | 23 | Text string `json:"text,omitempty"` |
24 | 24 | Team string `json:"team,omitempty"` |
25 | File File `json:"file,omitempty"` | |
25 | File *File `json:"file,omitempty"` | |
26 | 26 | // Type may come if it's part of a message list |
27 | 27 | // e.g.: channel.history |
28 | 28 | Type string `json:"type,omitempty"` |
23 | 23 | // channel_deleted |
24 | 24 | // channel_archive |
25 | 25 | // channel_unarchive |
26 | Type string `json:"type"` | |
27 | ChannelId string `json:"channel"` | |
28 | UserId string `json:"user,omitempty"` | |
29 | Timestamp JSONTimeString `json:"ts,omitempty"` | |
26 | Type string `json:"type"` | |
27 | ChannelId string `json:"channel"` | |
28 | UserId string `json:"user,omitempty"` | |
29 | Timestamp *JSONTimeString `json:"ts,omitempty"` | |
30 | 30 | } |
31 | 31 | |
32 | 32 | type ChannelRenameEvent struct { |
1 | 1 | |
2 | 2 | type TeamJoinEvent struct { |
3 | 3 | Type string `json:"type"` |
4 | User User `json:"user,omitempty"` | |
4 | User *User `json:"user,omitempty"` | |
5 | 5 | } |
6 | 6 | |
7 | 7 | type TeamRenameEvent struct { |
8 | Type string `json:"type"` | |
9 | Name string `json:"name,omitempty"` | |
10 | EventTimestamp JSONTimeString `json:"event_ts,omitempty"` | |
8 | Type string `json:"type"` | |
9 | Name string `json:"name,omitempty"` | |
10 | EventTimestamp *JSONTimeString `json:"event_ts,omitempty"` | |
11 | 11 | } |
12 | 12 | |
13 | 13 | type TeamPrefChangeEvent struct { |