Skip to main content

io_jmap/
calendars.rs

1//! JMAP for Calendars (draft-ietf-jmap-calendars-27).
2//!
3//! The only domain of the JMAP suite still moving through the working
4//! group, hence the only module named for its domain instead of its
5//! RFC: it is renamed to `rfcNNNN` the day the number exists, the type
6//! names being already stable. Revisions are named here and nowhere
7//! else, and no section number is cited anywhere in the module, a
8//! reference into a moving target being worse than none.
9//!
10//! Two data types are covered, both read-only for now: [`calendar`],
11//! the collection, and [`calendar_event`], a JSCalendar Event or Task
12//! (RFC 8984) kept as raw JSON the way [`crate::rfc9610`] keeps its
13//! JSContact payload.
14
15use alloc::string::String;
16
17use serde::Deserialize;
18
19pub mod calendar;
20pub mod calendar_event;
21
22/// JMAP for Calendars capability (draft-ietf-jmap-calendars).
23pub const JMAP_CALENDARS_CAPABILITY: &str = "urn:ietf:params:jmap:calendars";
24
25/// Value of the calendars capability in an account's
26/// `accountCapabilities` property (draft-ietf-jmap-calendars).
27#[derive(Clone, Debug, Default, Deserialize)]
28#[serde(rename_all = "camelCase")]
29pub struct JmapCalendarsCapability {
30    /// Max number of Calendars assignable to a single CalendarEvent;
31    /// `None` for no limit.
32    #[serde(default)]
33    pub max_calendars_per_event: Option<u64>,
34    /// Earliest date-time the server accepts, in UTC.
35    #[serde(default)]
36    pub min_date_time: Option<String>,
37    /// Latest date-time the server accepts, in UTC.
38    #[serde(default)]
39    pub max_date_time: Option<String>,
40    /// Longest time range an expanded `CalendarEvent/query` may span,
41    /// as an ISO 8601 duration.
42    #[serde(default)]
43    pub max_expanded_query_duration: Option<String>,
44    /// Max number of participants a single CalendarEvent may carry;
45    /// `None` for no limit.
46    #[serde(default)]
47    pub max_participants_per_event: Option<u64>,
48    /// Whether the user may create a Calendar in this account.
49    #[serde(default)]
50    pub may_create_calendar: bool,
51}