194 lines
5.4 KiB
Protocol Buffer
194 lines
5.4 KiB
Protocol Buffer
// 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;
|
|
}
|