robespierre_models/
core.rs1#[derive(serde::Deserialize, Clone)]
4#[serde(deny_unknown_fields)]
5pub struct RevoltConfiguration {
6 pub revolt: String,
7 pub features: RevoltInstanceFeatures,
8 pub ws: String,
9 pub app: String,
10 pub vapid: String,
11}
12
13#[derive(serde::Deserialize, Clone)]
15#[serde(transparent)]
16#[serde(deny_unknown_fields)]
17pub struct Autumn(EnabledUrl);
18
19impl Autumn {
20 pub fn is_enabled(&self) -> bool {
22 self.0.enabled
23 }
24
25 pub fn url(&self) -> &String {
27 &self.0.url
28 }
29}
30
31#[derive(serde::Deserialize, Clone)]
33#[serde(transparent)]
34#[serde(deny_unknown_fields)]
35pub struct January(EnabledUrl);
36
37impl January {
38 pub fn is_enabled(&self) -> bool {
40 self.0.enabled
41 }
42
43 pub fn url(&self) -> &String {
45 &self.0.url
46 }
47}
48
49#[derive(serde::Deserialize, Clone)]
51#[serde(transparent)]
52#[serde(deny_unknown_fields)]
53pub struct Voso(EnabledUrlWs);
54
55impl Voso {
56 pub fn is_enabled(&self) -> bool {
58 self.0.enabled
59 }
60
61 pub fn url(&self) -> &String {
63 &self.0.url
64 }
65
66 pub fn ws_url(&self) -> &String {
68 &self.0.ws
69 }
70}
71
72#[derive(serde::Deserialize, Clone)]
73#[serde(deny_unknown_fields)]
74struct EnabledUrl {
75 enabled: bool,
76 url: String,
77}
78
79#[derive(serde::Deserialize, Clone)]
80#[serde(deny_unknown_fields)]
81struct EnabledUrlWs {
82 enabled: bool,
83 url: String,
84 ws: String,
85}
86
87#[derive(serde::Deserialize, Clone)]
90#[serde(deny_unknown_fields)]
91pub struct RevoltInstanceFeatures {
92 pub captcha: CaptchaInfo,
94 pub email: bool,
96 pub invite_only: bool,
98 pub autumn: Autumn,
100 pub january: January,
102 pub voso: Voso,
104}
105
106#[derive(serde::Deserialize, Clone)]
108#[serde(deny_unknown_fields)]
109pub struct CaptchaInfo {
110 pub enabled: bool,
112 pub key: String,
114}