#![allow(unused_imports)]
use crate::objects::*;
use crate::{
CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
};
use serde::{Deserialize, Serialize};
#[doc(alias = "bots.info")]
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
#[non_exhaustive]
pub struct BotsInfoRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub bot: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub team_id: Option<String>,
}
impl BotsInfoRequest {
pub fn new() -> Self {
Self {
bot: None,
team_id: None,
}
}
pub fn bot(mut self, bot: impl Into<String>) -> Self {
self.bot = Some(bot.into());
self
}
pub fn team_id(mut self, team_id: impl Into<String>) -> Self {
self.team_id = Some(team_id.into());
self
}
}
impl SlackApiMethod for BotsInfoRequest {
const METHOD: &'static str = "bots.info";
type Response = BotsInfoResponse;
}
#[doc(alias = "bots.info")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct BotsInfoResponse {
#[serde(
default,
deserialize_with = "crate::de::opt_object",
skip_serializing_if = "Option::is_none"
)]
pub bot: Option<Bot>,
#[serde(
default,
deserialize_with = "crate::de::opt_object",
skip_serializing_if = "Option::is_none"
)]
pub response_metadata: Option<ResponseMetadata>,
#[serde(
default,
deserialize_with = "crate::de::opt_string",
skip_serializing_if = "Option::is_none"
)]
pub warning: Option<String>,
}
impl SlackClient {
#[doc(alias = "bots.info")]
pub async fn bots_info(
&self,
request: &BotsInfoRequest,
) -> Result<BotsInfoResponse, SlackError> {
self.call(request).await
}
}