inital webhook support

This commit is contained in:
Zomatree
2022-11-26 23:07:22 +00:00
parent ee1c4cc2d5
commit 5cb2320760
31 changed files with 653 additions and 38 deletions

View File

@@ -1,4 +1,4 @@
use crate::models::channel::{Channel, FieldsChannel, PartialChannel};
use crate::models::{channel::{Channel, FieldsChannel, PartialChannel}};
use crate::{OverrideField, Result};
#[async_trait]

View File

@@ -0,0 +1,11 @@
use crate::models::webhook::{Webhook, PartialWebhook, FieldsWebhook};
use crate::Result;
#[async_trait]
pub trait AbstractWebhook: Sync + Send {
async fn insert_webhook(&self, webhook: &Webhook) -> Result<()>;
async fn fetch_webhook(&self, webhook_id: &str) -> Result<Webhook>;
async fn delete_webhook(&self, webhook_id: &str) -> Result<()>;
async fn update_webook(&self, webhook_id: &str, partial_webhook: &PartialWebhook, remove: &[FieldsWebhook]) -> Result<()>;
async fn fetch_webhooks_for_channel(&self, channel: &str) -> Result<Vec<Webhook>>;
}