slack_web_api/api/
bots.rs1#![allow(unused_imports)]
4
5use crate::objects::*;
6use crate::{
7 CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
8};
9use serde::{Deserialize, Serialize};
10
11#[doc(alias = "bots.info")]
15#[derive(Debug, Clone, PartialEq, Serialize, Default)]
16#[non_exhaustive]
17pub struct BotsInfoRequest {
18 #[serde(skip_serializing_if = "Option::is_none")]
20 pub bot: Option<String>,
21 #[serde(skip_serializing_if = "Option::is_none")]
23 pub team_id: Option<String>,
24}
25
26impl BotsInfoRequest {
27 pub fn new() -> Self {
28 Self {
29 bot: None,
30 team_id: None,
31 }
32 }
33
34 pub fn bot(mut self, bot: impl Into<String>) -> Self {
35 self.bot = Some(bot.into());
36 self
37 }
38
39 pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
40 self.team_id = Some(team_id.into());
41 self
42 }
43}
44
45impl SlackApiMethod for BotsInfoRequest {
46 const METHOD: &'static str = "bots.info";
47 type Response = BotsInfoResponse;
48}
49
50#[doc(alias = "bots.info")]
52#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
53pub struct BotsInfoResponse {
54 #[serde(
55 default,
56 deserialize_with = "crate::de::opt_object",
57 skip_serializing_if = "Option::is_none"
58 )]
59 pub bot: Option<Bot>,
60 #[serde(
61 default,
62 deserialize_with = "crate::de::opt_object",
63 skip_serializing_if = "Option::is_none"
64 )]
65 pub response_metadata: Option<ResponseMetadata>,
66 #[serde(
67 default,
68 deserialize_with = "crate::de::opt_string",
69 skip_serializing_if = "Option::is_none"
70 )]
71 pub warning: Option<String>,
72}
73
74impl SlackClient {
75 #[doc(alias = "bots.info")]
88 pub async fn bots_info(
89 &self,
90 request: &BotsInfoRequest,
91 ) -> Result<BotsInfoResponse, SlackError> {
92 self.call(request).await
93 }
94}