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