files_sdk/admin/
action_notification_exports.rs1use crate::{Result, client::FilesClient};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize, Clone)]
5pub struct ActionNotificationExportEntity {
6 #[serde(flatten)]
7 pub data: serde_json::Map<String, serde_json::Value>,
8}
9
10pub struct ActionNotificationExportHandler {
11 client: FilesClient,
12}
13
14impl ActionNotificationExportHandler {
15 pub fn new(client: FilesClient) -> Self {
16 Self { client }
17 }
18
19 pub async fn get(&self, id: i64) -> Result<ActionNotificationExportEntity> {
20 let endpoint = format!("/action_notification_exports/{}", id);
21 let response = self.client.get_raw(&endpoint).await?;
22 Ok(serde_json::from_value(response)?)
23 }
24
25 pub async fn create(
26 &self,
27 params: serde_json::Value,
28 ) -> Result<ActionNotificationExportEntity> {
29 let response = self
30 .client
31 .post_raw("/action_notification_exports", params)
32 .await?;
33 Ok(serde_json::from_value(response)?)
34 }
35}