1
2use serde::Deserialize;
3use time::OffsetDateTime;
4
5#[derive(Deserialize, Debug, Clone)]
6#[serde(rename_all = "camelCase")]
7#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
8pub struct UserSettings {
12 pub user_number: i64,
13 pub name: String,
14 pub username: String,
15 pub image: String,
16 pub header_image: Option<String>,
17 pub offline_image: Option<String>,
18 pub bio: Option<String>,
19 pub pronouns: Option<String>,
20 pub bluesky_url: Option<String>,
21 pub website_url: Option<String>,
22 pub discord_url: Option<String>,
23 pub kofi_url: Option<String>,
24 pub chat_color: Option<String>,
25 pub gaming_shelf: Vec<GameInfo>,
26 #[serde(with = "time::serde::iso8601")]
27 pub created_at: OffsetDateTime,
28 #[serde(with = "time::serde::iso8601::option")]
29 pub followed_at: Option<OffsetDateTime>,
30 #[serde(with = "time::serde::iso8601::option")]
31 pub banned_until: Option<OffsetDateTime>,
32 pub is_subscriber: bool,
33 pub is_alt_stream_supporter: bool,
34 pub is_channel_supporter: bool,
35 pub is_site_admin: bool,
36 pub tester_badge: Option<String>,
37 pub channel_points_name: Option<String>,
38 pub referral_count: u64,
39 pub is_referral_badge_unlocked: bool,
40}
41
42#[derive(Deserialize, Debug, Clone)]
43#[serde(rename_all = "camelCase")]
44#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
45pub struct ChannelEmotes {
49 pub channel: String,
50 pub emotes: Vec<ChannelEmoteInfo>,
51}
52
53#[derive(Deserialize, Debug, Clone)]
54#[serde(rename_all = "camelCase")]
55#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
56pub struct ChannelEmoteInfo {
60 pub id: i64,
61 pub name: String,
62 pub url: String,
63 pub display_order: i64,
64}
65
66#[derive(Deserialize, Debug, Clone)]
67#[serde(rename_all = "camelCase")]
68#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
69pub struct ChannelRewards {
73 pub channel: String,
74 pub rewards: Vec<ChannelRewardInfo>,
75}
76
77#[derive(Deserialize, Debug, Clone)]
78#[serde(rename_all = "camelCase")]
79#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
80pub struct ChannelRewardInfo {
84 pub id: i64,
85 pub name: String,
86 pub description: Option<String>,
87 pub cost: u64,
88 pub enabled: bool,
89 pub is_highlight: bool,
90 pub cooldown_seconds: Option<u64>,
91 pub global_cooldown_seconds: Option<u64>,
92 pub max_per_stream: Option<u64>,
93 pub max_global_per_stream: Option<u64>,
95}
96
97#[derive(Deserialize, Debug, Clone)]
98#[serde(rename_all = "camelCase")]
99#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
100pub struct Panels {
104 pub channel: String,
105 pub panels: Vec<PanelInfo>,
106}
107
108#[derive(Deserialize, Debug, Clone)]
109#[serde(rename_all = "camelCase")]
110#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
111pub struct PanelInfo {
115 pub id: i64,
116 pub slug: String,
117 pub title: String,
118 pub content: String, pub display_order: i64,
120}
121
122#[derive(Deserialize, Debug, Clone)]
123#[serde(rename_all = "camelCase")]
124#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
125pub struct ChannelInfo {
129 pub avatar_url: String,
130 pub bio: Option<String>,
131 #[serde(with = "time::serde::iso8601")]
132 pub created_at: OffsetDateTime,
133 pub display_name: String,
134 pub stream: StreamInfo,
135 pub username: String,
136}
137
138#[derive(Deserialize, Debug, Clone)]
139#[serde(rename_all = "camelCase")]
140#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
141pub struct StreamInfo {
145 pub is_live: bool,
146 #[serde(with = "time::serde::iso8601::option")]
147 pub started_at: Option<OffsetDateTime>,
148 pub title: String,
149 #[serde(rename = "viewers")]
150 pub viewer_count: u64,
151 pub game: Option<GameInfo>,
152 pub tags: Vec<String>,
153}
154
155#[derive(Deserialize, Debug, Clone)]
156#[serde(rename_all = "camelCase")]
157#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
158pub struct StreamTags {
162 pub channel: String,
163 pub tags: Vec<String>,
164}
165
166#[derive(Deserialize, Debug, Clone)]
167#[serde(rename_all = "camelCase")]
168#[cfg_attr(feature = "api_debug", serde(deny_unknown_fields))]
169pub struct GameInfo {
173 pub id: i64,
174 pub igdb_id: Option<i64>,
175 pub name: String,
176 pub summary: Option<String>,
177 pub slug: String,
178 pub cover_url: Option<String>,
179 pub ai_details: Option<serde_json::Value>, pub ai_disclosed: Option<bool>,
181 pub steam_app_id: Option<String>, pub has_steam_disclosure: Option<bool>,
183}