supercode-interchange 0.4.15

Canonical, provider-neutral session interchange primitives for Supercode
Documentation
//! Webhook subscriptions (ยง2.6; Hermes `webhook_subscriptions.json`).

use schemars::JsonSchema;
use serde::{Deserialize, Serialize};

use super::Target;
use crate::ontology::{Residue, SecretRef};

/// One subscription: the route is `/webhooks/<name>`.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, JsonSchema)]
pub struct WebhookSubscription {
    /// The name.
    pub name: String,
    /// The HMAC secret, by reference.
    #[serde(default)]
    pub secret: Option<SecretRef>,
    /// Accepted event names; all when absent.
    #[serde(default)]
    pub events: Option<Vec<String>>,
    /// The prompt, rendered with the payload.
    #[serde(default)]
    pub prompt_template: String,
    /// Where the answer goes.
    #[serde(default)]
    pub deliver: Option<Target>,
    /// Skills to load.
    #[serde(default)]
    pub skills: Vec<String>,
    /// Description.
    #[serde(default)]
    pub description: Option<String>,
    /// Creation, RFC3339.
    #[serde(default)]
    pub created_at: Option<String>,
    /// Unmodeled fields, verbatim.
    #[serde(default)]
    pub residue: Residue,
}