slack_chat_api/admin_conversations_ekm.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct AdminConversationsEkm {
5 pub client: Client,
6}
7
8impl AdminConversationsEkm {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 AdminConversationsEkm { client }
12 }
13
14 /**
15 * This function performs a `GET` to the `/admin.conversations.ekm.listOriginalConnectedChannelInfo` endpoint.
16 *
17 * List all disconnected channels—i.e., channels that were once connected to other workspaces and then disconnected—and the corresponding original channel IDs for key revocation with EKM.
18 *
19 * FROM: <https://api.slack.com/methods/admin.conversations.ekm.listOriginalConnectedChannelInfo>
20 *
21 * **Parameters:**
22 *
23 * * `token: &str` -- Authentication token. Requires scope: `admin.conversations:read`.
24 * * `channel_ids: &str` -- A comma-separated list of channels to filter to.
25 * * `team_ids: &str` -- A comma-separated list of the workspaces to which the channels you would like returned belong.
26 * * `limit: i64` -- The maximum number of items to return. Must be between 1 - 1000 both inclusive.
27 * * `cursor: &str` -- Set `cursor` to `next_cursor` returned by the previous call to list items in the next page.
28 */
29 pub async fn list_original_connected_channel_info(
30 &self,
31 channel_ids: &str,
32 team_ids: &str,
33 limit: i64,
34 cursor: &str,
35 ) -> ClientResult<crate::Response<crate::types::DndEndSchema>> {
36 let mut query_args: Vec<(String, String)> = Default::default();
37 if !channel_ids.is_empty() {
38 query_args.push(("channel_ids".to_string(), channel_ids.to_string()));
39 }
40 if !cursor.is_empty() {
41 query_args.push(("cursor".to_string(), cursor.to_string()));
42 }
43 if limit > 0 {
44 query_args.push(("limit".to_string(), limit.to_string()));
45 }
46 if !team_ids.is_empty() {
47 query_args.push(("team_ids".to_string(), team_ids.to_string()));
48 }
49 let query_ = serde_urlencoded::to_string(&query_args).unwrap();
50 let url = self.client.url(
51 &format!(
52 "/admin.conversations.ekm.listOriginalConnectedChannelInfo?{}",
53 query_
54 ),
55 None,
56 );
57 self.client
58 .get(
59 &url,
60 crate::Message {
61 body: None,
62 content_type: None,
63 },
64 )
65 .await
66 }
67}