revolt_database/models/channel_webhooks/
ops.rs1use revolt_result::Result;
2
3use crate::{FieldsWebhook, PartialWebhook, Webhook};
4
5#[cfg(feature = "mongodb")]
6mod mongodb;
7mod reference;
8
9#[async_trait]
10pub trait AbstractWebhooks: Sync + Send {
11 async fn insert_webhook(&self, webhook: &Webhook) -> Result<()>;
13
14 async fn fetch_webhook(&self, webhook_id: &str) -> Result<Webhook>;
16
17 async fn fetch_webhooks_for_channel(&self, channel_id: &str) -> Result<Vec<Webhook>>;
19
20 async fn update_webhook(
22 &self,
23 webhook_id: &str,
24 partial: &PartialWebhook,
25 remove: &[FieldsWebhook],
26 ) -> Result<()>;
27
28 async fn delete_webhook(&self, webhook_id: &str) -> Result<()>;
30}