-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathreddit.proto
193 lines (171 loc) · 5.44 KB
/
reddit.proto
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
// Package redditproto defines protobuffers all of the types Reddit uses in
// their JSON api. These types are numbered t[1-6]. Each message is commented
// according to its data type.
// These messages are _not_ necessarily directly derived from the Reddit types.
// These messages are built based on what is useful to be read and used, not
// what is easy to parse from Reddit's responses.
syntax = "proto2";
package redditproto;
// Data type t1_
message Comment {
extensions 100 to max;
optional string approved_by = 1;
optional string author = 2;
optional string author_flair_css_class = 3;
optional string author_flair_text = 4;
optional string banned_by = 5;
optional string body = 6;
optional string body_html = 7;
// Field 8 is reserved for "edited".
optional int32 gilded = 9;
optional string link_author = 10;
optional string link_url = 11;
optional int32 num_reports = 12;
optional string parent_id = 13;
repeated Comment replies = 14;
optional string subreddit = 15;
optional string subreddit_id = 16;
optional string distinguished = 17;
// Implements Created
optional double created = 18;
optional double created_utc = 19;
// Implements Votable
optional int32 ups = 20;
optional int32 downs = 21;
optional bool likes = 22;
// Implements Thing
optional string id = 23;
optional string name = 24;
// Message-Comment hybrid fields; these are present when the comment is
// actually a Message in the inbox, but Reddit still labels the object "t1"
// (Comment) because that is its original type.
optional string subject = 25;
}
// Data type t2_
message Account {
extensions 100 to max;
optional int32 comment_karma = 1;
optional bool has_mail = 2;
optional bool has_mod_mail = 3;
optional bool has_verified_email = 4;
optional int32 inbox_count = 5;
optional bool is_friend = 6;
optional bool is_gold = 7;
optional bool is_mod = 8;
optional int32 link_karma = 9;
optional string modhash = 10;
optional bool over_18 = 11;
optional int32 gold_credits = 12;
optional double gold_expiration = 13;
optional bool hide_from_robots = 14;
// Implements Created
optional double created = 15;
optional double created_utc = 16;
// Implements Thing
optional string id = 17;
optional string name = 18;
}
// Data type t3_
message Link {
extensions 100 to max;
optional string author = 1;
optional string author_flair_css_class = 2;
optional string author_flair_text = 3;
optional bool clicked = 4;
optional string domain = 5;
optional bool hidden = 6;
optional bool is_self = 7;
optional string link_flair_css_class = 8;
optional string link_flair_text = 9;
// Field 10 is reserved for "media".
// Field 11 is reserved for "media_embed".
optional int32 num_comments = 12;
optional bool over_18 = 13;
optional string permalink = 14;
optional bool saved = 15;
optional int32 score = 16;
optional string selftext = 17;
optional string selftext_html = 18;
optional string subreddit = 19;
optional string subreddit_id = 20;
optional string thumbnail = 21;
optional string title = 22;
optional string url = 23;
// Field 24 is reserved for "edited".
optional string distinguished = 24;
optional bool stickied = 25;
// Implements Created
optional double created = 26;
optional double created_utc = 27;
// Implements Votable
optional int32 ups = 28;
optional int32 downs = 29;
optional bool likes = 30;
// Implements Thing
optional string id = 31;
optional string name = 32;
// Comment tree (not provided by Reddit).
repeated Comment comments = 33;
}
// LinkSet holds links and data set annotations.
message LinkSet {
extensions 100 to max;
repeated Link links = 1;
optional string data = 2;
}
// Data type t4_
message Message {
extensions 100 to max;
optional string author = 1;
optional string body = 2;
optional string body_html = 3;
optional string context = 4;
// Field 5 reserved for mystic "first_message".
optional string first_message_name = 6;
optional bool likes = 7;
optional string link_title = 8;
optional bool new = 9;
optional string parent_id = 10;
optional string replies = 11;
optional string subject = 12;
optional string subreddit = 13;
optional bool was_comment = 14;
// Implements Created
optional double created = 15;
optional double created_utc = 16;
// Implements Thing
optional string id = 17;
optional string name = 18;
// This field contains the chronological sequence of messages following this
// one.
repeated Message messages = 19;
}
// Data type t5_
message Subreddit {
extensions 100 to max;
optional int32 accounts_active = 1;
optional int32 comment_score = 2;
optional string description = 3;
optional string description_html = 4;
optional string display_name = 5;
optional string header_img = 6;
// Field 7 is reserved for "header_size".
optional string header_title = 7;
optional bool over18 = 8;
optional string public_description = 9;
optional bool public_traffic = 10;
optional int64 subscribers = 11;
optional string submission_type = 12;
optional string submit_link_label = 13;
optional string submit_text_label = 14;
optional string subreddit_type = 15;
optional string title = 16;
optional string url = 17;
optional bool user_is_banned = 18;
optional bool user_is_contributor = 19;
optional bool user_is_moderator = 20;
optional bool user_is_subscriber = 21;
// Implements Thing
optional string id = 22;
optional string name = 24;
}