Skip to main content

io_msgraph/v1/rest/users/
calendars.rs

1//! Microsoft Graph calendars (`users.calendars`): list, get, create,
2//! update, delete.
3//!
4//! <https://learn.microsoft.com/en-us/graph/api/resources/calendar>
5
6use alloc::string::String;
7
8use serde::{Deserialize, Serialize};
9
10use crate::v1::{field::MsgraphField, rest::users::messages::MsgraphEmailAddress};
11
12pub mod create;
13pub mod delete;
14pub mod get;
15pub mod list;
16pub mod update;
17
18/// A calendar of the user. Doubles as the create/update body.
19#[derive(Debug, Clone, Default, Deserialize, Serialize, Eq, PartialEq)]
20#[serde(rename_all = "camelCase")]
21pub struct MsgraphCalendar {
22    /// The unique identifier of the calendar.
23    #[serde(default, skip_serializing_if = "String::is_empty")]
24    pub id: String,
25    /// The calendar name.
26    #[serde(default, skip_serializing_if = "MsgraphField::is_unset")]
27    pub name: MsgraphField<String>,
28    /// The theme colour (`auto`, `lightBlue`, `lightGreen`...).
29    #[serde(default, skip_serializing_if = "MsgraphField::is_unset")]
30    pub color: MsgraphField<String>,
31    /// The colour as `#RRGGBB`, read-only.
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub hex_color: Option<String>,
34    /// The version of the calendar, changing with every edit.
35    #[serde(default, skip_serializing_if = "Option::is_none")]
36    pub change_key: Option<String>,
37    /// Whether the user can write to the calendar.
38    #[serde(default, skip_serializing_if = "Option::is_none")]
39    pub can_edit: Option<bool>,
40    /// Whether this is the user's default calendar.
41    #[serde(default, skip_serializing_if = "Option::is_none")]
42    pub is_default_calendar: Option<bool>,
43    /// Whether the calendar can be deleted from the user's mailbox.
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub is_removable: Option<bool>,
46    /// The owner of a shared calendar, or the user.
47    #[serde(default, skip_serializing_if = "Option::is_none")]
48    pub owner: Option<MsgraphEmailAddress>,
49}