#[non_exhaustive]pub struct CalendarAlert {
pub at_type: String,
pub account_id: Id,
pub calendar_event_id: Id,
pub uid: String,
pub recurrence_id: Option<String>,
pub alert_id: String,
pub extra: Map<String, Value>,
}Expand description
Push-notification payload emitted when a calendar alert fires (draft-ietf-jmap-calendars-33 §6.4).
Sent over the JMAP push channel when the server determines that an alert for a CalendarEvent should fire. Clients receiving this payload should trigger the appropriate local notification (e.g. an OS alert).
recurrenceId is null for non-recurring events and MUST serialize as
null (not be omitted) — the receiver uses its presence to distinguish
recurring from non-recurring.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.at_type: StringObject type discriminator; always "CalendarAlert" on the wire.
Deserialize is liberal: if @type is absent (spec-violating
vendor input), this field defaults to "CalendarAlert" rather
than failing the whole parent object’s deserialize. Serialize
always emits the field. See bd:JMAP-ky8g.10.
account_id: IdThe account that owns the calendar event.
calendar_event_id: IdId of the CalendarEvent for which this alert is firing.
uid: StringThe UID property of the iCalendar object underlying the calendar event.
recurrence_id: Option<String>The recurrenceId of the specific occurrence, or null for non-recurring
events (draft-ietf-jmap-calendars-33 §6.4).
Serializes as null when None — intentionally NOT marked
skip_serializing_if so the receiver can distinguish recurring from
non-recurring events.
Maintainer note: do NOT add #[serde(skip_serializing_if = "Option::is_none")]
to this field. Adding it would silently break the spec contract:
per draft-ietf-jmap-calendars-33 §6.4, the receiver uses the
presence of recurrenceId to determine whether the alert
fired for a recurring or non-recurring event. An omitted field
is indistinguishable from a sender that forgot to include it; an
explicit null carries the “non-recurring” signal. This is the
same “required-and-nullable” wire shape used by
PrincipalCalendarsCapability.account_id in capability.rs:121.
A “clippy clean-up”, “consistency PR”, or pattern-based code
audit may flag this field as inconsistent with neighbours that
use skip_serializing_if and propose to “fix” it. That is a
silent wire-protocol break. The regression test
calendar_alert_recurrence_id_null_for_non_recurring (in
tests/types_test.rs) pins the current behavior. Design defense:
bd:JMAP-1rwf.7.
alert_id: StringId of the Alert object within the CalendarEvent that is firing.
extra: Map<String, Value>Catch-all for vendor / site / private extension fields not covered by the typed fields above. Preserves unknown fields across deserialize/serialize round-trip per workspace extras-preservation policy (see workspace AGENTS.md).