use super::channel::RESTAPIAttachment;
use super::poll::RESTAPIPoll;
use crate::models::payloads::{
APIAllowedMentions, APIEmbed, APIMessage, APIMessageTopLevelComponent, APIWebhook, MessageFlags,
};
use serde::{Deserialize, Serialize};
use serde_json::Value;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPostAPIChannelWebhookJSONBody {
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<Option<String>>,
}
pub type RESTPostAPIChannelWebhookResult = APIWebhook;
pub type RESTGetAPIChannelWebhooksResult = Vec<APIWebhook>;
pub type RESTGetAPIGuildWebhooksResult = Vec<APIWebhook>;
pub type RESTGetAPIWebhookResult = APIWebhook;
pub type RESTGetAPIWebhookWithTokenResult = APIWebhook;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPatchAPIWebhookJSONBody {
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<Option<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub channel_id: Option<String>,
}
pub type RESTPatchAPIWebhookResult = APIWebhook;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPatchAPIWebhookWithTokenJSONBody {
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<Option<String>>,
}
pub type RESTPatchAPIWebhookWithTokenResult = RESTGetAPIWebhookWithTokenResult;
pub type RESTDeleteAPIWebhookResult = ();
pub type RESTDeleteAPIWebhookWithTokenResult = ();
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPostAPIWebhookWithTokenJSONBody {
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tts: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub embeds: Option<Vec<APIEmbed>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_mentions: Option<APIAllowedMentions>,
#[serde(skip_serializing_if = "Option::is_none")]
pub components: Option<Vec<APIMessageTopLevelComponent>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attachments: Option<Vec<RESTAPIAttachment>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub flags: Option<MessageFlags>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub applied_tags: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub poll: Option<RESTAPIPoll>,
}
pub type RESTPostAPIWebhookWithTokenFormDataBody = Value;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPostAPIWebhookWithTokenQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub wait: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub with_components: Option<bool>,
}
pub type RESTPostAPIWebhookWithTokenResult = ();
pub type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPostAPIWebhookWithTokenSlackQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wait: Option<bool>,
}
pub type RESTPostAPIWebhookWithTokenSlackResult = ();
pub type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPostAPIWebhookWithTokenGitHubQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub wait: Option<bool>,
}
pub type RESTPostAPIWebhookWithTokenGitHubResult = ();
pub type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
pub type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTGetAPIWebhookWithTokenMessageQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub struct RESTPatchAPIWebhookWithTokenMessageJSONBody {
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_mentions: Option<Option<APIAllowedMentions>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub components: Option<Option<Vec<APIMessageTopLevelComponent>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<Option<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub embeds: Option<Option<Vec<APIEmbed>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attachments: Option<Vec<RESTAPIAttachment>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub poll: Option<RESTAPIPoll>,
}
pub type RESTPatchAPIWebhookWithTokenMessageFormDataBody = Value;
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
pub struct RESTPatchAPIWebhookWithTokenMessageQuery {
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub with_components: Option<bool>,
}
pub type RESTPatchAPIWebhookWithTokenMessageResult = APIMessage;
pub type RESTDeleteAPIWebhookWithTokenMessageResult = ();