zeroentropy_community/resources/
status.rs

1use crate::client::Client;
2use crate::error::Result;
3use crate::types::StatusResponse;
4
5/// Status resource for checking account status
6pub struct Status<'a> {
7    client: &'a Client,
8}
9
10impl<'a> Status<'a> {
11    pub(crate) fn new(client: &'a Client) -> Self {
12        Self { client }
13    }
14
15    /// Get account status including document and collection counts
16    ///
17    /// # Example
18    /// ```no_run
19    /// # use zeroentropy_community::Client;
20    /// # async fn example() -> Result<(), Box<dyn std::error::Error>> {
21    /// let client = Client::from_env()?;
22    /// let status = client.status().get_status().await?;
23    /// println!("Documents: {}, Collections: {}", 
24    ///     status.num_documents, 
25    ///     status.num_collections
26    /// );
27    /// # Ok(())
28    /// # }
29    /// ```
30    pub async fn get_status(&self) -> Result<StatusResponse> {
31        self.client.post("/status/get-status", &serde_json::json!({})).await
32    }
33}