Skip to main content

Module graph

Module graph 

Source
Expand description

Microsoft Graph API client.

Re-exports§

pub use events::EventsPage;
pub use events::NewEvent;
pub use events::ProposedTime;
pub use events::RsvpKind;
pub use events::cancel_event;
pub use events::create_event;
pub use events::delete_event;
pub use events::get_event;
pub use events::list_calendar_view;
pub use events::list_events_at;
pub use events::move_event_to_calendar;
pub use events::move_time;
pub use events::rsvp_event;
pub use events::update_event;

Modules§

batch
Graph $batch: up to 20 sub-requests per round-trip.
delta
Graph delta queries: “what changed since last time”.
events
Microsoft Graph calendar event endpoints.

Structs§

GraphClient
Stateful Microsoft Graph client. Holds an AuthClient and a shared HTTP client.
InboxPage
One page of inbox messages plus a flag indicating whether more pages exist.
MailFolder
A mail folder as returned by Graph’s /me/mailFolders endpoint.
Me
Outgoing
What the user is sending — pre-Graph-serialization shape.
Person
A person from /me/people, with the first scored e-mail address Graph returned (entries without any scored address are skipped entirely).

Functions§

add_attachment
POST /me/messages/{id}/attachments — attach a file to a draft.
create_child_folder
POST /me/mailFolders/{parent_id}/childFolders — create a child folder under parent_id, returning it.
create_draft
POST /me/messages — create a draft message in the Drafts folder. Returns the new draft’s Graph message ID.
create_forward_draft
POST /me/messages/{id}/createForward — create a forward draft with the given recipients already populated.
create_mail_folder
POST /me/mailFolders — create a new top-level folder, returning it.
create_reply_all_draft
POST /me/messages/{id}/createReplyAll — create a reply-all draft.
create_reply_draft
POST /me/messages/{id}/createReply — create a reply draft. Returns the new draft’s Graph message ID.
delete_attachment
DELETE /me/messages/{id}/attachments/{att_id}.
delete_mail_folder
DELETE /me/mailFolders/{id} — delete a folder. Outlook moves the folder (and any contents) to Deleted Items, so this is recoverable. Works for top-level and child folders alike.
delete_message
DELETE /me/messages/{id} — moves the message to Deleted Items. Same call works for drafts and for inbox messages; the destination folder differs only by what the user is currently in.
fetch_message_headers
GET /me/messages/{id}?$select=internetMessageHeaders — fetch just the raw RFC 5322 headers for a message. Used by pidge mail unsubscribe to locate List-Unsubscribe / List-Unsubscribe-Post.
forward_message
Forward — sends immediately, with HTML-formatted comment.
get_attachment_bytes
GET /me/messages/{id}/attachments/{attachment_id} — fetch a single attachment with its base64 contentBytes. Returns the decoded bytes.
get_categories
GET /me/messages/{id}?$select=categories — read a message’s categories.
get_me
get_message
GET /me/messages/{id} — fetch a single message with full body.
list_attachments
GET /me/messages/{id}/attachments — list attachments without fetching bytes. Filters to file attachments only.
list_calendars
list_child_folders
GET /me/mailFolders/{parent_id}/childFolders — list a folder’s immediate children. Same shape and paging as list_mail_folders.
list_drafts
List a page of drafts from the Drafts folder. Drafts don’t have a real “received” time, so Graph sorts by lastModifiedDateTime desc here.
list_folder_messages
List a page of messages from an arbitrary folder, identified by its Graph folder ID (or a well-known name). Same shape as list_inbox; used by mail list --folder to page through custom folders.
list_inbox
List a page of messages from the Inbox folder, sorted by receivedDateTime desc.
list_mail_folders
GET /me/mailFolders — list the top-level mail folders (id, displayName, counts). Pages through @odata.nextLink so mailboxes with many folders are fully enumerated rather than silently truncated at one page.
list_messages_at
Fetch a page of messages at an absolute Graph URL (an @odata.nextLink carried in a pidge cursor). Continues any listing or search stream. A link off Graph (or off base_url in tests) is refused before any request.
list_people
GET /me/people?$top={top}&$select=displayName,scoredEmailAddresses
mark_read
PATCH /me/messages/{id} — mark the message as read.
mark_unread
PATCH /me/messages/{id} — mark the message as unread.
move_message
POST /me/messages/{id}/move — move the message to another folder.
reply_all_message
Reply-all variant of reply_message.
reply_message
Reply to a message — sends immediately. Uses createReply + body PATCH + send so the comment is delivered as HTML and the user’s paragraph and line breaks survive Outlook’s HTML rendering.
search_folder_messages
Like search_messages, restricted to one folder (a well-known name such as inbox, or a folder id).
search_messages
send_draft
POST /me/messages/{id}/send — send an existing draft.
send_mail
POST /me/sendMail — compose-and-send a new message in one call.
set_categories
PATCH /me/messages/{id} with { "categories": [...] } — replace categories.
set_flag
PATCH /me/messages/{id} — set or clear the follow-up flag.
unsubscribe_one_click
POST List-Unsubscribe=One-Click to the given URL per RFC 8058. The body is form-urlencoded (the RFC says so explicitly).
update_draft
PATCH /me/messages/{id} — overwrite a draft’s editable fields. Only the fields in Outgoing are patched, since that’s what our wizard owns.
update_draft_recipients
PATCH /me/messages/{id} — replace only the recipient lists that are Some, leaving subject and body (e.g. a reply’s quoted history) intact.