#![allow(unused_imports)]
use crate::objects::*;
use crate::{
CursorPaginated, NextCursor, ResponseMetadata, SlackApiMethod, SlackClient, SlackError,
};
use serde::{Deserialize, Serialize};
#[doc(alias = "api.test")]
#[derive(Debug, Clone, PartialEq, Serialize, Default)]
#[non_exhaustive]
pub struct ApiTestRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
impl ApiTestRequest {
pub fn new() -> Self {
Self { error: None }
}
pub fn error(mut self, error: impl Into<String>) -> Self {
self.error = Some(error.into());
self
}
}
impl SlackApiMethod for ApiTestRequest {
const METHOD: &'static str = "api.test";
type Response = ApiTestResponse;
}
#[doc(alias = "api.test")]
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ApiTestResponse {
#[serde(
default,
deserialize_with = "crate::de::opt_object",
skip_serializing_if = "Option::is_none"
)]
pub args: Option<ApiTestResponseArgs>,
#[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>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct ApiTestResponseArgs {
#[serde(
default,
deserialize_with = "crate::de::opt_string",
skip_serializing_if = "Option::is_none"
)]
pub foo: Option<String>,
}
impl SlackClient {
#[doc(alias = "api.test")]
pub async fn api_test(&self, request: &ApiTestRequest) -> Result<ApiTestResponse, SlackError> {
self.call(request).await
}
}