slack_api/async_impl/mods/emoji.rs
1//=============================================================================
2//
3// WARNING: This file is AUTO-GENERATED
4//
5// Do not make changes directly to this file.
6//
7// If you would like to make a change to the library, please update the schema
8// definitions at https://github.com/slack-rs/slack-api-schemas
9//
10// If you would like to make a change how the library was generated,
11// please edit https://github.com/slack-rs/slack-rs-api/tree/master/codegen
12//
13//=============================================================================
14
15pub use crate::mod_types::emoji_types::*;
16use crate::requests::SlackWebRequestSender;
17
18/// Lists custom emoji for a team.
19///
20/// Wraps https://api.slack.com/methods/emoji.list
21
22pub async fn list<R>(client: &R, token: &str) -> Result<ListResponse, ListError<R::Error>>
23where
24 R: SlackWebRequestSender,
25{
26 let params = &[("token", token)];
27 let url = crate::get_slack_url_for_method("emoji.list");
28 client
29 .send(&url, ¶ms[..])
30 .await
31 .map_err(ListError::Client)
32 .and_then(|result| {
33 serde_json::from_str::<ListResponse>(&result)
34 .map_err(|e| ListError::MalformedResponse(result, e))
35 })
36 .and_then(|o| o.into())
37}