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#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
23#[serde(rename_all = "camelCase")]
24pub struct MsgraphAttachment {
25    /// The unique identifier of the attachment.
26    #[serde(default, skip_serializing_if = "String::is_empty")]
27    pub id: String,
28    /// The file name of the attachment.
29    #[serde(default, skip_serializing_if = "Option::is_none")]
30    pub name: Option<String>,
31    /// The MIME type of the attachment content.
32    #[serde(default, skip_serializing_if = "Option::is_none")]
33    pub content_type: Option<String>,
34    /// The size of the attachment in bytes.
35    #[serde(default, skip_serializing_if = "Option::is_none")]
36    pub size: Option<i64>,
37    /// Whether the attachment is displayed inline in the body.
38    #[serde(default, skip_serializing_if = "Option::is_none")]
39    pub is_inline: Option<bool>,
40    /// The last modification date, as an ISO 8601 date-time.
41    #[serde(default, skip_serializing_if = "Option::is_none")]
42    pub last_modified_date_time: Option<String>,
43    /// The base64-encoded content, for the `fileAttachment` subtype.
44    #[serde(default, skip_serializing_if = "Option::is_none")]
45    pub content_bytes: Option<String>,
46}