slack_chat_api/
admin_apps_restricted.rs1use crate::Client;
2use crate::ClientResult;
3
4pub struct AdminAppsRestricted {
5 pub client: Client,
6}
7
8impl AdminAppsRestricted {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 AdminAppsRestricted { client }
12 }
13
14 pub async fn list(
30 &self,
31 limit: i64,
32 cursor: &str,
33 team_id: &str,
34 enterprise_id: &str,
35 ) -> ClientResult<crate::Response<crate::types::DndEndSchema>> {
36 let mut query_args: Vec<(String, String)> = Default::default();
37 if !cursor.is_empty() {
38 query_args.push(("cursor".to_string(), cursor.to_string()));
39 }
40 if !enterprise_id.is_empty() {
41 query_args.push(("enterprise_id".to_string(), enterprise_id.to_string()));
42 }
43 if limit > 0 {
44 query_args.push(("limit".to_string(), limit.to_string()));
45 }
46 if !team_id.is_empty() {
47 query_args.push(("team_id".to_string(), team_id.to_string()));
48 }
49 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
50 let url = self
51 .client
52 .url(&format!("/admin.apps.restricted.list?{}", query_), None);
53 self.client
54 .get(
55 &url,
56 crate::Message {
57 body: None,
58 content_type: None,
59 },
60 )
61 .await
62 }
63}