Skip to main content

brainwires_a2a/
push_notification.rs

1//! Push notification configuration types.
2
3use serde::{Deserialize, Serialize};
4
5/// Authentication details for push notifications.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct AuthenticationInfo {
8    /// HTTP authentication scheme (e.g. `Bearer`, `Basic`).
9    pub scheme: String,
10    /// Credentials (format depends on scheme).
11    #[serde(skip_serializing_if = "Option::is_none")]
12    pub credentials: Option<String>,
13}
14
15/// Push notification configuration for a task.
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct TaskPushNotificationConfig {
18    /// Optional tenant identifier.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub tenant: Option<String>,
21    /// Configuration identifier.
22    #[serde(rename = "configId", skip_serializing_if = "Option::is_none")]
23    pub config_id: Option<String>,
24    /// Associated task identifier.
25    #[serde(rename = "taskId")]
26    pub task_id: String,
27    /// URL where the notification should be sent.
28    pub url: String,
29    /// Session/task-specific token.
30    #[serde(skip_serializing_if = "Option::is_none")]
31    pub token: Option<String>,
32    /// Authentication information for sending the notification.
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub authentication: Option<AuthenticationInfo>,
35    /// ISO 8601 timestamp when this configuration was created.
36    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
37    pub created_at: Option<String>,
38}