pub struct SlackClientHttpSessionApi<'a, SCHC>where
    SCHC: SlackClientHttpConnector + Send,
{ pub span: Span, /* private fields */ }

Fields§

§span: Span

Implementations§

Examples found in repository?
src/api/auth.rs (lines 24-28)
22
23
24
25
26
27
28
29
30
    pub async fn auth_test(&self) -> ClientResult<SlackApiAuthTestResponse> {
        self.http_session_api
            .http_get(
                "auth.test",
                &crate::client::SLACK_HTTP_EMPTY_GET_PARAMS.clone(),
                Some(&AUTH_TEST_SPECIAL_LIMIT_RATE_CTL),
            )
            .await
    }
More examples
Hide additional examples
src/api/bots.rs (lines 26-30)
21
22
23
24
25
26
27
28
29
30
31
32
    pub async fn bots_info(
        &self,
        req: &SlackApiBotsInfoRequest,
    ) -> ClientResult<SlackApiBotsInfoResponse> {
        self.http_session_api
            .http_get(
                "bots.info",
                &vec![("bot", req.bot.as_ref())],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }
src/api/team.rs (lines 26-30)
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
    pub async fn team_info(
        &self,
        req: &SlackApiTeamInfoRequest,
    ) -> ClientResult<SlackApiTeamInfoResponse> {
        self.http_session_api
            .http_get(
                "team.info",
                &vec![("team", req.team.as_ref())],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/team.profile.get
    ///
    pub async fn team_profile_get(
        &self,
        req: &SlackApiTeamProfileGetRequest,
    ) -> ClientResult<SlackApiTeamProfileGetResponse> {
        self.http_session_api
            .http_get(
                "team.profile.get",
                &vec![("visibility", req.visibility.as_ref())],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }
src/api/chat.rs (lines 61-68)
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
    pub async fn chat_get_permalink(
        &self,
        req: &SlackApiChatGetPermalinkRequest,
    ) -> ClientResult<SlackApiChatGetPermalinkResponse> {
        self.http_session_api
            .http_get(
                "chat.getPermalink",
                &vec![
                    ("channel", Some(&req.channel.value())),
                    ("message_ts", Some(&req.message_ts.value())),
                ],
                Some(&CHAT_GET_PERMLINK_SPECIAL_LIMIT_RATE_CTL),
            )
            .await
    }
src/api/reactions.rs (lines 28-37)
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    pub async fn reactions_get(
        &self,
        req: &SlackApiReactionsGetRequest,
    ) -> ClientResult<SlackApiReactionsGetResponse> {
        self.http_session_api
            .http_get(
                "reactions.get",
                &vec![
                    ("channel", req.channel.as_ref().map(|x| x.value())),
                    ("file", req.file.as_ref().map(|x| x.value())),
                    ("full", req.full.map(|v| v.to_string()).as_ref()),
                    ("timestamp", req.timestamp.as_ref().map(|x| x.value())),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }
src/api/conversations.rs (lines 72-83)
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
    pub async fn conversations_history(
        &self,
        req: &SlackApiConversationsHistoryRequest,
    ) -> ClientResult<SlackApiConversationsHistoryResponse> {
        self.http_session_api
            .http_get(
                "conversations.history",
                &vec![
                    ("channel", req.channel.as_ref().map(|x| x.value())),
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                    ("inclusive", req.inclusive.map(|v| v.to_string()).as_ref()),
                    ("latest", req.latest.as_ref().map(|x| x.value())),
                    ("oldest", req.oldest.as_ref().map(|x| x.value())),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.info
    ///
    pub async fn conversations_info(
        &self,
        req: &SlackApiConversationsInfoRequest,
    ) -> ClientResult<SlackApiConversationsInfoResponse> {
        self.http_session_api
            .http_get(
                "conversations.info",
                &vec![
                    ("channel", Some(req.channel.value())),
                    (
                        "include_num_members",
                        req.include_num_members.map(|v| v.to_string()).as_ref(),
                    ),
                    (
                        "include_locale",
                        req.include_locale.map(|v| v.to_string()).as_ref(),
                    ),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.invite
    ///
    pub async fn conversations_invite(
        &self,
        req: &SlackApiConversationsInviteRequest,
    ) -> ClientResult<SlackApiConversationsInviteResponse> {
        self.http_session_api
            .http_post(
                "conversations.invite",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.join
    ///
    pub async fn conversations_join(
        &self,
        req: &SlackApiConversationsJoinRequest,
    ) -> ClientResult<SlackApiConversationsJoinResponse> {
        self.http_session_api
            .http_post("conversations.join", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.kick
    ///
    pub async fn conversations_kick(
        &self,
        req: &SlackApiConversationsKickRequest,
    ) -> ClientResult<SlackApiConversationsKickResponse> {
        self.http_session_api
            .http_post("conversations.kick", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.leave
    ///
    pub async fn conversations_leave(
        &self,
        req: &SlackApiConversationsLeaveRequest,
    ) -> ClientResult<SlackApiConversationsLeaveResponse> {
        self.http_session_api
            .http_post("conversations.leave", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.list
    ///
    pub async fn conversations_list(
        &self,
        req: &SlackApiConversationsListRequest,
    ) -> ClientResult<SlackApiConversationsListResponse> {
        self.http_session_api
            .http_get(
                "conversations.list",
                &vec![
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                    (
                        "exclude_archived",
                        req.exclude_archived.map(|v| v.to_string()).as_ref(),
                    ),
                    (
                        "types",
                        req.types
                            .as_ref()
                            .map(|xs| {
                                xs.iter()
                                    .map(|x| x.to_string())
                                    .collect::<Vec<String>>()
                                    .join(",")
                            })
                            .as_ref(),
                    ),
                ],
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.members
    ///
    pub async fn conversations_members(
        &self,
        req: &SlackApiConversationsMembersRequest,
    ) -> ClientResult<SlackApiConversationsMembersResponse> {
        self.http_session_api
            .http_get(
                "conversations.members",
                &vec![
                    ("channel", req.channel.as_ref().map(|x| x.value())),
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                ],
                Some(&SLACK_TIER4_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.open
    /// return_im is set to None
    ///
    pub async fn conversations_open(
        &self,
        req: &SlackApiConversationsOpenRequest,
    ) -> ClientResult<SlackApiConversationsOpenResponse<SlackBasicChannelInfo>> {
        self.http_session_api
            .http_post(
                "conversations.open",
                &req.clone().without_return_im(),
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.open
    /// return_im is set to Some(true)
    ///
    pub async fn conversations_open_full(
        &self,
        req: &SlackApiConversationsOpenRequest,
    ) -> ClientResult<SlackApiConversationsOpenResponse<SlackChannelInfo>> {
        self.http_session_api
            .http_post(
                "conversations.open",
                &req.clone().with_return_im(true),
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.rename
    ///
    pub async fn conversations_rename(
        &self,
        req: &SlackApiConversationsRenameRequest,
    ) -> ClientResult<SlackApiConversationsRenameResponse> {
        self.http_session_api
            .http_post(
                "conversations.rename",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.replies
    ///
    pub async fn conversations_replies(
        &self,
        req: &SlackApiConversationsRepliesRequest,
    ) -> ClientResult<SlackApiConversationsRepliesResponse> {
        self.http_session_api
            .http_get(
                "conversations.replies",
                &vec![
                    ("channel", Some(req.channel.value())),
                    ("ts", Some(req.ts.value())),
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                    ("inclusive", req.inclusive.map(|v| v.to_string()).as_ref()),
                    ("latest", req.latest.as_ref().map(|x| x.value())),
                    ("oldest", req.oldest.as_ref().map(|x| x.value())),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }
source

pub async fn http_post<RQ, RS>(
    &self,
    method_relative_uri: &str,
    request: &RQ,
    rate_control_params: Option<&'a SlackApiMethodRateControlConfig>
) -> ClientResult<RS>where
    RQ: Serialize + Send + Sync,
    RS: for<'de> Deserialize<'de> + Send,

Examples found in repository?
src/api/views.rs (line 27)
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
    pub async fn views_open(
        &self,
        req: &SlackApiViewsOpenRequest,
    ) -> ClientResult<SlackApiViewsOpenResponse> {
        self.http_session_api
            .http_post("views.open", req, Some(&SLACK_TIER4_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/views.publish
    ///
    pub async fn views_publish(
        &self,
        req: &SlackApiViewsPublishRequest,
    ) -> ClientResult<SlackApiViewsPublishResponse> {
        self.http_session_api
            .http_post("views.publish", req, Some(&SLACK_TIER4_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/views.push
    ///
    pub async fn views_push(
        &self,
        req: &SlackApiViewsPushRequest,
    ) -> ClientResult<SlackApiViewsPushResponse> {
        self.http_session_api
            .http_post("views.push", req, Some(&SLACK_TIER4_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/views.update
    ///
    pub async fn views_update(
        &self,
        req: &SlackApiViewsUpdateRequest,
    ) -> ClientResult<SlackApiViewsUpdateResponse> {
        self.http_session_api
            .http_post("views.update", req, Some(&SLACK_TIER4_METHOD_CONFIG))
            .await
    }
More examples
Hide additional examples
src/api/chat.rs (line 33)
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
    pub async fn chat_delete(
        &self,
        req: &SlackApiChatDeleteRequest,
    ) -> ClientResult<SlackApiChatDeleteResponse> {
        self.http_session_api
            .http_post("chat.delete", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.deleteScheduledMessage
    ///
    pub async fn chat_delete_scheduled_message(
        &self,
        req: &SlackApiChatDeleteScheduledMessageRequest,
    ) -> ClientResult<SlackApiChatDeleteScheduledMessageResponse> {
        self.http_session_api
            .http_post(
                "chat.deleteScheduledMessage",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.getPermalink
    ///
    pub async fn chat_get_permalink(
        &self,
        req: &SlackApiChatGetPermalinkRequest,
    ) -> ClientResult<SlackApiChatGetPermalinkResponse> {
        self.http_session_api
            .http_get(
                "chat.getPermalink",
                &vec![
                    ("channel", Some(&req.channel.value())),
                    ("message_ts", Some(&req.message_ts.value())),
                ],
                Some(&CHAT_GET_PERMLINK_SPECIAL_LIMIT_RATE_CTL),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.postEphemeral
    ///
    pub async fn chat_post_ephemeral(
        &self,
        req: &SlackApiChatPostEphemeralRequest,
    ) -> ClientResult<SlackApiChatPostEphemeralResponse> {
        self.http_session_api
            .http_post("chat.postEphemeral", req, Some(&SLACK_TIER4_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.postMessage
    ///
    pub async fn chat_post_message(
        &self,
        req: &SlackApiChatPostMessageRequest,
    ) -> ClientResult<SlackApiChatPostMessageResponse> {
        self.http_session_api
            .http_post(
                "chat.postMessage",
                req,
                Some(&CHAT_POST_MESSAGE_SPECIAL_LIMIT_RATE_CTL),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.scheduleMessage
    ///
    pub async fn chat_schedule_message(
        &self,
        req: &SlackApiChatScheduleMessageRequest,
    ) -> ClientResult<SlackApiChatScheduleMessageResponse> {
        self.http_session_api
            .http_post(
                "chat.scheduleMessage",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// The old/legacy version of unfurl with channel/ts
    /// https://api.slack.com/methods/chat.unfurl
    ///
    pub async fn chat_unfurl(
        &self,
        req: &SlackApiChatUnfurlRequest,
    ) -> ClientResult<SlackApiChatUnfurlResponse> {
        self.http_session_api
            .http_post("chat.unfurl", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// The version for unfurl with source/unfurl_id
    /// https://api.slack.com/methods/chat.unfurl
    ///
    pub async fn chat_unfurl_v2(
        &self,
        req: &SlackApiChatUnfurlRequestV2,
    ) -> ClientResult<SlackApiChatUnfurlResponse> {
        self.http_session_api
            .http_post("chat.unfurl", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.update
    ///
    pub async fn chat_update(
        &self,
        req: &SlackApiChatUpdateRequest,
    ) -> ClientResult<SlackApiChatUpdateResponse> {
        self.http_session_api
            .http_post("chat.update", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/chat.scheduledMessages.list
    ///
    pub async fn chat_scheduled_messages_list(
        &self,
        req: &SlackApiChatScheduledMessagesListRequest,
    ) -> ClientResult<SlackApiChatScheduledMessagesListResponse> {
        self.http_session_api
            .http_post(
                "chat.scheduledMessages.list",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }
src/api/reactions.rs (line 49)
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
    pub async fn reactions_add(
        &self,
        req: &SlackApiReactionsAddRequest,
    ) -> ClientResult<SlackApiReactionsAddResponse> {
        self.http_session_api
            .http_post("reactions.add", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/reactions.remove
    ///
    pub async fn reactions_remove(
        &self,
        req: &SlackApiReactionsRemoveRequest,
    ) -> ClientResult<SlackApiReactionsRemoveResponse> {
        self.http_session_api
            .http_post("reactions.remove", req, Some(&SLACK_TIER2_METHOD_CONFIG))
            .await
    }
src/api/users.rs (line 156)
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
    pub async fn users_set_presence(
        &self,
        req: &SlackApiUsersSetPresenceRequest,
    ) -> ClientResult<SlackApiUsersSetPresenceResponse> {
        self.http_session_api
            .http_post("users.setPresence", req, Some(&SLACK_TIER2_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/users.profile.get
    ///
    pub async fn users_profile_get(
        &self,
        req: &SlackApiUsersProfileGetRequest,
    ) -> ClientResult<SlackApiUsersProfileGetResponse> {
        self.http_session_api
            .http_get(
                "users.profile.get",
                &vec![
                    ("user", req.user.as_ref().map(|v| v.value())),
                    (
                        "include_locale",
                        req.include_locale.map(|v| v.to_string()).as_ref(),
                    ),
                ],
                Some(&SLACK_TIER4_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/users.profile.set
    ///
    pub async fn users_profile_set(
        &self,
        req: &SlackApiUsersProfileSetRequest,
    ) -> ClientResult<SlackApiUsersProfileSetResponse> {
        self.http_session_api
            .http_post("users.profile.set", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }
src/api/apps.rs (lines 28-32)
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    pub async fn apps_connections_open(
        &self,
        req: &SlackApiAppsConnectionOpenRequest,
    ) -> ClientResult<SlackApiAppsConnectionOpenResponse> {
        self.http_session_api
            .http_post(
                "apps.connections.open",
                req,
                Some(&SLACK_TIER1_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/apps.manifest.create
    ///
    pub async fn apps_manifest_create(
        &self,
        req: &SlackApiAppsManifestCreateRequest,
    ) -> ClientResult<SlackApiAppsManifestCreateResponse> {
        self.http_session_api
            .http_post(
                "apps.manifest.create",
                req,
                Some(&SLACK_TIER1_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/apps.manifest.delete
    ///
    pub async fn apps_manifest_delete(
        &self,
        req: &SlackApiAppsManifestDeleteRequest,
    ) -> ClientResult<()> {
        self.http_session_api
            .http_post(
                "apps.manifest.delete",
                req,
                Some(&SLACK_TIER1_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/apps.manifest.export
    ///
    pub async fn apps_manifest_export(
        &self,
        req: &SlackApiAppsManifestExportRequest,
    ) -> ClientResult<SlackApiAppsManifestExportResponse> {
        self.http_session_api
            .http_post(
                "apps.manifest.export",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/apps.manifest.update
    ///
    pub async fn apps_manifest_update(
        &self,
        req: &SlackApiAppsManifestUpdateRequest,
    ) -> ClientResult<SlackApiAppsManifestUpdateResponse> {
        self.http_session_api
            .http_post(
                "apps.manifest.update",
                req,
                Some(&SLACK_TIER1_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/apps.manifest.validate
    ///
    pub async fn apps_manifest_validate(
        &self,
        req: &SlackApiAppsManifestValidateRequest,
    ) -> ClientResult<()> {
        self.http_session_api
            .http_post(
                "apps.manifest.validate",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }
src/api/conversations.rs (lines 28-32)
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
    pub async fn conversations_archive(
        &self,
        req: &SlackApiConversationsArchiveRequest,
    ) -> ClientResult<SlackApiConversationsArchiveResponse> {
        self.http_session_api
            .http_post(
                "conversations.archive",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.close
    ///
    pub async fn conversations_close(
        &self,
        req: &SlackApiConversationsCloseRequest,
    ) -> ClientResult<SlackApiConversationsCloseResponse> {
        self.http_session_api
            .http_post("conversations.close", req, Some(&SLACK_TIER2_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.create
    ///
    pub async fn conversations_create(
        &self,
        req: &SlackApiConversationsCreateRequest,
    ) -> ClientResult<SlackApiConversationsCreateResponse> {
        self.http_session_api
            .http_post(
                "conversations.create",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.history
    ///
    pub async fn conversations_history(
        &self,
        req: &SlackApiConversationsHistoryRequest,
    ) -> ClientResult<SlackApiConversationsHistoryResponse> {
        self.http_session_api
            .http_get(
                "conversations.history",
                &vec![
                    ("channel", req.channel.as_ref().map(|x| x.value())),
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                    ("inclusive", req.inclusive.map(|v| v.to_string()).as_ref()),
                    ("latest", req.latest.as_ref().map(|x| x.value())),
                    ("oldest", req.oldest.as_ref().map(|x| x.value())),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.info
    ///
    pub async fn conversations_info(
        &self,
        req: &SlackApiConversationsInfoRequest,
    ) -> ClientResult<SlackApiConversationsInfoResponse> {
        self.http_session_api
            .http_get(
                "conversations.info",
                &vec![
                    ("channel", Some(req.channel.value())),
                    (
                        "include_num_members",
                        req.include_num_members.map(|v| v.to_string()).as_ref(),
                    ),
                    (
                        "include_locale",
                        req.include_locale.map(|v| v.to_string()).as_ref(),
                    ),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.invite
    ///
    pub async fn conversations_invite(
        &self,
        req: &SlackApiConversationsInviteRequest,
    ) -> ClientResult<SlackApiConversationsInviteResponse> {
        self.http_session_api
            .http_post(
                "conversations.invite",
                req,
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.join
    ///
    pub async fn conversations_join(
        &self,
        req: &SlackApiConversationsJoinRequest,
    ) -> ClientResult<SlackApiConversationsJoinResponse> {
        self.http_session_api
            .http_post("conversations.join", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.kick
    ///
    pub async fn conversations_kick(
        &self,
        req: &SlackApiConversationsKickRequest,
    ) -> ClientResult<SlackApiConversationsKickResponse> {
        self.http_session_api
            .http_post("conversations.kick", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.leave
    ///
    pub async fn conversations_leave(
        &self,
        req: &SlackApiConversationsLeaveRequest,
    ) -> ClientResult<SlackApiConversationsLeaveResponse> {
        self.http_session_api
            .http_post("conversations.leave", req, Some(&SLACK_TIER3_METHOD_CONFIG))
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.list
    ///
    pub async fn conversations_list(
        &self,
        req: &SlackApiConversationsListRequest,
    ) -> ClientResult<SlackApiConversationsListResponse> {
        self.http_session_api
            .http_get(
                "conversations.list",
                &vec![
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                    (
                        "exclude_archived",
                        req.exclude_archived.map(|v| v.to_string()).as_ref(),
                    ),
                    (
                        "types",
                        req.types
                            .as_ref()
                            .map(|xs| {
                                xs.iter()
                                    .map(|x| x.to_string())
                                    .collect::<Vec<String>>()
                                    .join(",")
                            })
                            .as_ref(),
                    ),
                ],
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.members
    ///
    pub async fn conversations_members(
        &self,
        req: &SlackApiConversationsMembersRequest,
    ) -> ClientResult<SlackApiConversationsMembersResponse> {
        self.http_session_api
            .http_get(
                "conversations.members",
                &vec![
                    ("channel", req.channel.as_ref().map(|x| x.value())),
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                ],
                Some(&SLACK_TIER4_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.open
    /// return_im is set to None
    ///
    pub async fn conversations_open(
        &self,
        req: &SlackApiConversationsOpenRequest,
    ) -> ClientResult<SlackApiConversationsOpenResponse<SlackBasicChannelInfo>> {
        self.http_session_api
            .http_post(
                "conversations.open",
                &req.clone().without_return_im(),
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.open
    /// return_im is set to Some(true)
    ///
    pub async fn conversations_open_full(
        &self,
        req: &SlackApiConversationsOpenRequest,
    ) -> ClientResult<SlackApiConversationsOpenResponse<SlackChannelInfo>> {
        self.http_session_api
            .http_post(
                "conversations.open",
                &req.clone().with_return_im(true),
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.rename
    ///
    pub async fn conversations_rename(
        &self,
        req: &SlackApiConversationsRenameRequest,
    ) -> ClientResult<SlackApiConversationsRenameResponse> {
        self.http_session_api
            .http_post(
                "conversations.rename",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.replies
    ///
    pub async fn conversations_replies(
        &self,
        req: &SlackApiConversationsRepliesRequest,
    ) -> ClientResult<SlackApiConversationsRepliesResponse> {
        self.http_session_api
            .http_get(
                "conversations.replies",
                &vec![
                    ("channel", Some(req.channel.value())),
                    ("ts", Some(req.ts.value())),
                    ("cursor", req.cursor.as_ref().map(|x| x.value())),
                    ("limit", req.limit.map(|v| v.to_string()).as_ref()),
                    ("inclusive", req.inclusive.map(|v| v.to_string()).as_ref()),
                    ("latest", req.latest.as_ref().map(|x| x.value())),
                    ("oldest", req.oldest.as_ref().map(|x| x.value())),
                ],
                Some(&SLACK_TIER3_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.setPurpose
    ///
    pub async fn conversations_set_purpose(
        &self,
        req: &SlackApiConversationsSetPurposeRequest,
    ) -> ClientResult<SlackApiConversationsSetPurposeResponse> {
        self.http_session_api
            .http_post(
                "conversations.setPurpose",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.setTopic
    ///
    pub async fn conversations_set_topic(
        &self,
        req: &SlackApiConversationsSetTopicRequest,
    ) -> ClientResult<SlackApiConversationsSetTopicResponse> {
        self.http_session_api
            .http_post(
                "conversations.setTopic",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }

    ///
    /// https://api.slack.com/methods/conversations.unarchive
    ///
    pub async fn conversations_unarchive(
        &self,
        req: &SlackApiConversationsUnarchiveRequest,
    ) -> ClientResult<SlackApiConversationsUnarchiveResponse> {
        self.http_session_api
            .http_post(
                "conversations.setTopic",
                req,
                Some(&SLACK_TIER2_METHOD_CONFIG),
            )
            .await
    }
source

pub async fn http_post_uri<RQ, RS>(
    &self,
    full_uri: Url,
    request: &RQ,
    rate_control_params: Option<&'a SlackApiMethodRateControlConfig>
) -> ClientResult<RS>where
    RQ: Serialize + Send + Sync,
    RS: for<'de> Deserialize<'de> + Send,

Examples found in repository?
src/api/test.rs (line 26)
20
21
22
23
24
25
26
27
28
    pub async fn api_test(&self, req: &SlackApiTestRequest) -> ClientResult<SlackApiTestResponse> {
        let full_uri = SlackClientHttpApiUri::create_url_with_params(
            &SlackClientHttpApiUri::create_method_uri_path("api.test"),
            &vec![("foo", req.foo.as_ref()), ("error", req.error.as_ref())],
        );
        self.http_session_api
            .http_post_uri(full_uri, &req, Some(&SLACK_TIER4_METHOD_CONFIG))
            .await
    }

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more