Skip to main content

io_msgraph/v1/rest/users/
mail_folders.rs

1//! Microsoft Graph mail folders (`users.mailFolders`): list, get,
2//! create, update, delete, copy, move, list child folders.
3//!
4//! <https://learn.microsoft.com/en-us/graph/api/resources/mailfolder>
5
6use alloc::string::String;
7
8use serde::{Deserialize, Serialize};
9
10pub mod child_folders;
11pub mod copy;
12pub mod create;
13pub mod delete;
14pub mod get;
15pub mod list;
16pub mod r#move;
17pub mod update;
18
19/// A mail folder in a user's mailbox. Doubles as the create body, where
20/// only `display_name` (and optionally `is_hidden`) is serialized.
21#[derive(Debug, Clone, Default, Deserialize, Serialize, Eq, PartialEq)]
22#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
23#[serde(rename_all = "camelCase")]
24pub struct MsgraphMailFolder {
25    /// The unique identifier of the folder.
26    #[serde(default, skip_serializing_if = "String::is_empty")]
27    pub id: String,
28    /// The display name of the folder.
29    #[serde(default, skip_serializing_if = "String::is_empty")]
30    pub display_name: String,
31    /// The identifier of the parent folder.
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub parent_folder_id: Option<String>,
34    /// The number of immediate child folders.
35    #[serde(default, skip_serializing_if = "Option::is_none")]
36    pub child_folder_count: Option<u64>,
37    /// The number of unread items in the folder.
38    #[serde(default, skip_serializing_if = "Option::is_none")]
39    pub unread_item_count: Option<u64>,
40    /// The total number of items in the folder.
41    #[serde(default, skip_serializing_if = "Option::is_none")]
42    pub total_item_count: Option<u64>,
43    /// The size of the folder in bytes.
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub size_in_bytes: Option<u64>,
46    /// Whether the folder is hidden from folder listings.
47    #[serde(default, skip_serializing_if = "Option::is_none")]
48    pub is_hidden: Option<bool>,
49}