summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbaummarten <kuna@hollow.capital>2023-01-15 21:51:22 +0100
committerD. Scott Boggs <scott@tams.tech>2023-01-29 09:12:47 -0500
commitc99ae7f28e21644aa05177c732b1d61035badcb2 (patch)
treee5296cc96324dfefbb364a251db475282d0bf7ac
parentcf4f45bc84f8dafc2c38ee72f8112090f2db8e11 (diff)
api/v1/instance/rules
-rw-r--r--entities/src/instance.rs9
-rw-r--r--src/mastodon.rs3
2 files changed, 11 insertions, 1 deletions
diff --git a/entities/src/instance.rs b/entities/src/instance.rs
index ae725ee..3c742c4 100644
--- a/entities/src/instance.rs
+++ b/entities/src/instance.rs
@@ -45,3 +45,12 @@ pub struct Stats {
status_count: u64,
domain_count: u64,
}
+
+/// Statistics about the Mastodon instance.
+#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
+pub struct Rule {
+ /// An identifier for the rule.
+ pub id: String,
+ /// The rule to be followed.
+ pub text: String,
+}
diff --git a/src/mastodon.rs b/src/mastodon.rs
index 364788d..70aac72 100644
--- a/src/mastodon.rs
+++ b/src/mastodon.rs
@@ -20,9 +20,9 @@ use futures::TryStream;
use log::{as_debug, as_serde, debug, error, trace};
use mastodon_async_entities::attachment::ProcessedAttachment;
use reqwest::{multipart::Part, Client, RequestBuilder};
+use std::collections::HashMap;
use url::Url;
use uuid::Uuid;
-use std::collections::HashMap;
/// The Mastodon client is a smart pointer to this struct
#[derive(Debug)]
@@ -67,6 +67,7 @@ impl Mastodon {
(get) notifications: "notifications" => Notification,
(get) instance_peers: "instance/peers" => String,
(get) instance_activity: "instance/activity" => HashMap<String, String>,
+ (get) instance_rules: "instance/rules" => Rule,
(get) reports: "reports" => Report,
(get (q: &'a str, #[serde(skip_serializing_if = "Option::is_none")] limit: Option<u64>, following: bool,)) search_accounts: "accounts/search" => Account,
(get) get_endorsements: "endorsements" => Account,