use crate::{
models::webhooks::{Webhook, WebhookEventId, WebhookEventType, WebhookLog},
Secret,
};
use serde::{Deserialize, Serialize};
use std::collections::BTreeSet;
use url::Url;
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhookSubmit {
pub url: Url,
pub hmac_token: Option<Secret>,
pub event_types: BTreeSet<WebhookEventType>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhooksListRequest {
pub continuation: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhooksListResponse {
pub webhooks: Vec<Webhook>,
#[serde(skip_serializing_if = "Option::is_none")]
pub continuation: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhookBoolResponse(pub bool);
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhookLogListRequest {
pub continuation: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhookLogListResponse {
pub webhook_events: Vec<WebhookLog>,
#[serde(skip_serializing_if = "Option::is_none")]
pub continuation: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
pub struct WebhookEventReplayRequest {
pub webhook_event_id: WebhookEventId,
}