files_sdk/storage/
usage_daily_snapshots.rs

1use crate::{Result, client::FilesClient};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize, Clone)]
5pub struct UsageDailySnapshotEntity {
6    #[serde(flatten)]
7    pub data: serde_json::Map<String, serde_json::Value>,
8}
9
10pub struct UsageDailySnapshotHandler {
11    client: FilesClient,
12}
13
14impl UsageDailySnapshotHandler {
15    pub fn new(client: FilesClient) -> Self {
16        Self { client }
17    }
18
19    pub async fn list(&self) -> Result<Vec<UsageDailySnapshotEntity>> {
20        let response = self.client.get_raw("/usage_daily_snapshots").await?;
21        let entities: Vec<UsageDailySnapshotEntity> = serde_json::from_value(response)?;
22        Ok(entities)
23    }
24}