Skip to main content

io_msgraph/v1/rest/users/messages/
attachments.rs

1//! Microsoft Graph message attachments
2//! (`users.messages.attachments`): create, list, get raw content,
3//! delete.
4//!
5//! <https://learn.microsoft.com/en-us/graph/api/resources/attachment>
6
7use alloc::string::String;
8
9use serde::{Deserialize, Serialize};
10
11pub mod create;
12pub mod delete;
13pub mod get_raw;
14pub mod list;
15
16/// A message attachment.
17///
18/// Graph models several subtypes (`fileAttachment`, `itemAttachment`,
19/// `referenceAttachment`); this captures the common fields plus the
20/// `fileAttachment` content bytes (base64) when present.
21#[derive(Debug, Clone, Default, Deserialize, Serialize, Eq, PartialEq)]
22#[serde(rename_all = "camelCase")]
23pub struct MsgraphAttachment {
24    /// The unique identifier of the attachment.
25    #[serde(default, skip_serializing_if = "String::is_empty")]
26    pub id: String,
27    /// The file name of the attachment.
28    #[serde(default, skip_serializing_if = "Option::is_none")]
29    pub name: Option<String>,
30    /// The MIME type of the attachment content.
31    #[serde(default, skip_serializing_if = "Option::is_none")]
32    pub content_type: Option<String>,
33    /// The size of the attachment in bytes.
34    #[serde(default, skip_serializing_if = "Option::is_none")]
35    pub size: Option<i64>,
36    /// Whether the attachment is displayed inline in the body.
37    #[serde(default, skip_serializing_if = "Option::is_none")]
38    pub is_inline: Option<bool>,
39    /// The last modification date, as an ISO 8601 date-time.
40    #[serde(default, skip_serializing_if = "Option::is_none")]
41    pub last_modified_date_time: Option<String>,
42    /// The base64-encoded content, for the `fileAttachment` subtype.
43    #[serde(default, skip_serializing_if = "Option::is_none")]
44    pub content_bytes: Option<String>,
45}