pub struct Notification {
pub id: String,
pub priority: NotificationPriority,
pub require_ack: bool,
pub title: String,
pub body: String,
pub toast: bool,
pub issued_at: DateTime<Utc>,
pub issued_by: Option<String>,
pub expires_at: Option<DateTime<Utc>>,
pub acked_at: Option<DateTime<Utc>>,
pub edited_at: Option<DateTime<Utc>>,
pub acks_reset_at: Option<DateTime<Utc>>,
}Expand description
Notification body — used both for NotificationsListResult
entries and the NotificationNewParams push.
Fields§
§id: StringStable id minted by the backend (UUID v7). Identifies the notification for ack / history lookups.
priority: NotificationPriority§require_ack: boolWhether the user must explicitly click “確認” to dismiss. Non-acked notifications stay pinned on the Client App’s notification panel until clicked; acked ones drop into history.
title: String§body: String§toast: boolWhether to surface an OS toast for this notification — decoupled
from priority. true gives the full “make
sure they see it” treatment (persistent native toast; the agent
launches the Client App when it isn’t running; lands in the lock
screen / Action Center; re-pops on logon/unlock). false shows it
only in the in-app list. #[serde(default)] (⇒ false) just so a
pre-this-field body on the retained stream still decodes — it is
NOT a priority fallback; toast behaviour is driven solely by this
flag.
issued_at: DateTime<Utc>When the notification was created (backend wall clock).
issued_by: Option<String>Optional human-readable label of who created the
notification (e.g. "infra-team" in SPEC §2.12.8). Surfaced
in the Client App for context.
expires_at: Option<DateTime<Utc>>Optional expiry (SPEC §2.4.1 expires_at). Past this instant
the Client App stops surfacing the notification (it drops out
of toasts / the modal / the unread badge) even if never acked.
None ⇒ the notification never auto-expires. Additive +
optional so pre-Phase-E bodies on the wire still decode.
acked_at: Option<DateTime<Utc>>acked_at from this user’s perspective. Populated by
notifications.list for already-acked entries; never set on
notifications.new pushes (a fresh push by definition
hasn’t been acked yet).
edited_at: Option<DateTime<Utc>>When this notification was last edited (PATCH /api/notifications/{id}),
re-published with the same id + issued_at but new content. None
⇒ never edited. Lets the SPA show an “edited” badge and lets a client
recognise a re-published copy as a content update of one it already
holds (vs a fresh arrival). Additive + optional so pre-edit bodies on
the retained stream still decode.
acks_reset_at: Option<DateTime<Utc>>When an edit reset confirmations: any ack (read mark) recorded before
this instant is stale and the user must re-confirm the new content.
The agent’s notifications.list treats a read mark older than this as
unread; a connected client clears a locally-held ack older than this on
the live update. None ⇒ acks were never reset (the common case).
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§fn clone(&self) -> Notification
fn clone(&self) -> Notification
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Notification
impl Debug for Notification
Source§impl<'de> Deserialize<'de> for Notification
impl<'de> Deserialize<'de> for Notification
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Notification
impl JsonSchema for Notification
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more