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
use serde::Deserialize;
#[cfg(feature = "serialize")]
use serde::Serialize;

#[derive(Deserialize)]
#[cfg_attr(feature = "serialize", derive(Serialize))]
#[cfg_attr(feature = "debug_attr", derive(Debug))]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
pub struct Account {
    pub awardee_karma: u32,
    pub awarder_karma: u32,
    pub can_create_subreddit: bool,
    pub can_edit_name: bool,
    pub coins: u32,
    pub comment_karma: u32,
    pub created: f64,
    pub created_utc: f64,
    pub features: Features,
    pub force_password_reset: bool,
    pub gold_creddits: u32,
    /// I have no idea what the value should be since I don't have a gold subscribtion
    pub gold_expiration: Option<serde_json::Value>,
    pub has_android_subscription: bool,
    pub has_external_account: bool,
    pub has_gold_subscription: bool,
    pub has_ios_subscription: bool,
    pub has_mail: bool,
    pub has_mod_mail: bool,
    pub has_paypal_subscription: bool,
    pub has_stripe_subscription: bool,
    pub has_subscribed: bool,
    pub has_subscribed_to_premium: bool,
    pub has_verified_email: bool,
    pub has_visited_new_profile: bool,
    pub hide_from_robots: bool,
    pub icon_img: String,
    pub inbox_count: u32,
    pub in_beta: bool,
    pub in_chat: Option<bool>,
    pub in_redesign_beta: bool,
    pub id: String,
    pub is_employee: bool,
    pub is_gold: bool,
    pub is_mod: bool,
    pub is_sponsor: bool,
    pub is_suspended: bool,
    pub linked_identities: Vec<String>,
    pub link_karma: u32,
    pub name: String,
    pub new_modmail_exists: Option<bool>,
    pub num_friends: u32,
    pub oauth_client_id: String,
    pub over_18: bool,
    pub password_set: bool,
    pub pref_autoplay: bool,
    pub pref_clickgadget: u32,
    pub pref_geopopular: String,
    pub pref_nightmode: bool,
    pub pref_no_profanity: bool,
    pub pref_show_presence: bool,
    pub pref_show_snoovatar: bool,
    pub pref_show_trending: bool,
    pub pref_show_twitter: bool,
    pub pref_top_karma_subreddits: bool,
    pub pref_video_autoplay: bool,
    pub seen_give_award_tooltip: bool,
    pub seen_layout_switch: bool,
    pub seen_premium_adblock_modal: bool,
    pub seen_redesign_modal: bool,
    pub seen_subreddit_chat_ftux: bool,
    pub snoovatar_img: String,
    pub snoovatar_size: Option<[u32; 2]>,
    pub subreddit: Subreddit,
    pub total_karma: u32,
    /// No idea what this value should be since I've never been suspended
    pub suspension_expiration_utc: Option<serde_json::Value>,
    pub verified: bool,
}

#[derive(Deserialize)]
#[cfg_attr(feature = "serialize", derive(Serialize))]
#[cfg_attr(feature = "debug_attr", derive(Debug))]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
pub struct Features {
    awards_on_streams: bool,
    chat: bool,
    chat_subreddit: bool,
    chat_user_settings: bool,
    chat_group_rollout: bool,
    do_not_track: bool,
    expensive_coins_package: bool,
    econ_wallet_service: bool,
    is_email_permission_required: bool,
    mod_service_mute_writes: bool,
    mod_awards: bool,
    mweb_xpromo_modal_listing_click_daily_dismissible_ios: bool,
    modlog_copyright_removal: bool,
    mod_service_mute_reads: bool,
    mweb_xpromo_interstitial_comments_ios: bool,
    mweb_xpromo_interstitial_comments_android: bool,
    mweb_xpromo_modal_listing_click_daily_dismissible_android: bool,
    noreferrer_to_noopener: bool,
    promoted_trend_blanks: bool,
    premium_subscriptions_table: bool,
    report_service_handles_report_writes_to_db_for_helpdesk_reports: Option<bool>,
    report_service_handles_self_harm_reports: Option<bool>,
    report_service_handles_report_writes_to_db_for_modmail_reports: Option<bool>,
    reports_double_write_to_report_service_for_spam: Option<bool>,
    reports_double_write_to_report_service_for_modmail_reports: Option<bool>,
    report_service_handles_report_writes_to_db_for_sendbird_chats: Option<bool>,
    report_service_handles_accept_report: Option<bool>,
    reports_double_write_to_report_service_for_som: Option<bool>,
    reports_double_write_to_report_service_for_users: Option<bool>,
    report_service_handles_report_writes_to_db_for_users: Option<bool>,
    report_service_handles_report_writes_to_db: Option<bool>,
    reports_double_write_to_report_service_for_helpdesk_reports: Option<bool>,
    report_service_handles_report_writes_to_db_for_spam: Option<bool>,
    reports_double_write_to_report_service_for_sendbird_chats: Option<bool>,
    reports_double_write_to_report_service: Option<bool>,
    report_service_handles_report_writes_to_db_for_awards: Option<bool>,
    reports_double_write_to_report_service_for_awards: Option<bool>,
    resized_styles_images: Option<bool>,
    report_service_handles_report_writes_to_db_for_som: Option<bool>,
    show_amp_link: bool,
    show_nps_survey: bool,
    spez_modal: bool,
}

#[derive(Deserialize)]
#[cfg_attr(feature = "serialize", derive(Serialize))]
#[cfg_attr(feature = "debug_attr", derive(Debug))]
#[cfg_attr(feature = "deny_unknown_fields", serde(deny_unknown_fields))]
pub struct Subreddit {
    pub banner_img: String,
    /// I don't have an banner at the time of writing this, I'll assume it's the same as icon_size
    pub banner_size: Option<[u32; 2]>,
    pub coins: u32,
    /// This returns null on both my accounts so I have no idea what it should be
    pub community_icon: Option<serde_json::Value>,
    pub default_set: bool,
    pub description: String,
    pub disable_contributor_requests: bool,
    pub display_name: String,
    pub display_name_prefixed: String,
    pub free_form_reports: bool,
    /// This returns null on both my accounts so I have no idea what it should be
    pub header_img: Option<serde_json::Value>,
    /// I don't have an header at the time of writing this, I'll assume it's the same as icon_size
    pub header_size: Option<[u32; 2]>,
    pub icon_color: String,
    pub icon_img: String,
    pub icon_size: [u32; 2],
    pub is_default_banner: bool,
    pub is_default_icon: bool,
    pub key_color: String,
    pub link_flair_enabled: bool,
    pub link_flair_position: String,
    pub name: String,
    pub over_18: bool,
    pub previous_names: Vec<String>,
    pub primary_color: String,
    pub public_description: String,
    pub quarantine: bool,
    pub restrict_commenting: bool,
    pub restrict_posting: bool,
    pub show_media: bool,
    pub submit_link_label: String,
    pub submit_text_label: String,
    pub subscribers: u32,
    pub subreddit_type: String,
    pub title: String,
    pub url: String,
    pub user_is_banned: bool,
    pub user_is_contributor: bool,
    pub user_is_muted: bool,
    pub user_is_moderator: bool,
    pub user_is_subscriber: bool,
}