Skip to content

Commit

Permalink
feat: files.delete support. (#312)
Browse files Browse the repository at this point in the history
* Files delete.

* Fix review comments.
  • Loading branch information
dvc94ch authored Feb 9, 2025
1 parent 528fbcc commit babc68b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/api/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ where
)
.await
}

///
/// https://api.slack.com/methods/files.delete
///
pub async fn files_delete(
&self,
req: &SlackApiFilesDeleteRequest,
) -> ClientResult<SlackApiFilesDeleteResponse> {
self.http_session_api
.http_post("files.delete", req, Some(&SLACK_TIER3_METHOD_CONFIG))
.await
}
}

#[skip_serializing_none]
Expand Down Expand Up @@ -195,6 +207,16 @@ pub struct SlackApiFilesComplete {
pub title: Option<String>,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackApiFilesDeleteRequest {
pub file: SlackFileId,
}

#[skip_serializing_none]
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize, Builder)]
pub struct SlackApiFilesDeleteResponse {}

fn to_csv<S: Serializer>(x: &Option<Vec<SlackChannelId>>, s: S) -> Result<S::Ok, S::Error> {
match x {
None => s.serialize_none(),
Expand Down

0 comments on commit babc68b

Please sign in to comment.