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§
- Graph
Client - Stateful Microsoft Graph client. Holds an AuthClient and a shared HTTP client.
- Inbox
Page - One page of inbox messages plus a flag indicating whether more pages exist.
- Mail
Folder - A mail folder as returned by Graph’s
/me/mailFoldersendpoint. - 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 unsubscribeto locateList-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 deschere. - 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 bymail list --folderto 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.nextLinkso 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.nextLinkcarried in a pidge cursor). Continues any listing or search stream. A link off Graph (or offbase_urlin 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 asinbox, 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-Clickto 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
Outgoingare 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.