slack_chat_api/admin_apps.rs
1use crate::Client;
2use crate::ClientResult;
3
4pub struct AdminApps {
5 pub client: Client,
6}
7
8impl AdminApps {
9 #[doc(hidden)]
10 pub fn new(client: Client) -> Self {
11 AdminApps { client }
12 }
13
14 /**
15 * This function performs a `POST` to the `/admin.apps.approve` endpoint.
16 *
17 * Approve an app for installation on a workspace.
18 *
19 * FROM: <https://api.slack.com/methods/admin.apps.approve>
20 *
21 * **Parameters:**
22 *
23 * * `token: &str` -- Authentication token. Requires scope: `admin.apps:write`.
24 */
25 pub async fn approve(&self) -> ClientResult<crate::Response<crate::types::DndEndSchema>> {
26 let url = self.client.url("/admin.apps.approve", None);
27 self.client
28 .post(
29 &url,
30 crate::Message {
31 body: None,
32 content_type: Some("application/x-www-form-urlencoded".to_string()),
33 },
34 )
35 .await
36 }
37 /**
38 * This function performs a `POST` to the `/admin.apps.restrict` endpoint.
39 *
40 * Restrict an app for installation on a workspace.
41 *
42 * FROM: <https://api.slack.com/methods/admin.apps.restrict>
43 *
44 * **Parameters:**
45 *
46 * * `token: &str` -- Authentication token. Requires scope: `admin.apps:write`.
47 */
48 pub async fn restrict(&self) -> ClientResult<crate::Response<crate::types::DndEndSchema>> {
49 let url = self.client.url("/admin.apps.restrict", None);
50 self.client
51 .post(
52 &url,
53 crate::Message {
54 body: None,
55 content_type: Some("application/x-www-form-urlencoded".to_string()),
56 },
57 )
58 .await
59 }
60}