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