rive_http/platform_administration/
admin.rs

1use crate::prelude::*;
2use rive_models::{data::FetchMessagesData, message::BulkMessageResponse, stats::Stats};
3
4impl Client {
5    /// Fetch various technical statistics.
6    pub async fn query_stats(&self) -> Result<Stats> {
7        Ok(self
8            .client
9            .get(ep!(self, "/admin/stats"))
10            .auth(&self.authentication)
11            .send()
12            .await?
13            .json()
14            .await?)
15    }
16
17    /// This is a privileged route to globally fetch messages.
18    pub async fn globally_fetch_messages(
19        &self,
20        data: FetchMessagesData,
21    ) -> Result<BulkMessageResponse> {
22        Ok(self
23            .client
24            .get(ep!(self, "/admin/messages"))
25            .json(&data)
26            .auth(&self.authentication)
27            .send()
28            .await?
29            .json()
30            .await?)
31    }
32}