Resolve drives: the signed-in user's OneDrive, another user's, a SharePoint site's libraries, a group's library, or any drive by id. Each returns Graph's drive resource (id, driveType: personal, business or documentLibrary, owner, quota, webUrl); pass its id as opts.drive to the other namespaces.

Permissions. Files.Read (own drive), Files.Read.All or Sites.Read.All (others); app-only: Files.Read.All, Sites.Read.All, or Sites.Selected with a grant on the site.

Functions

get-drive

fn (ref: Any): Map
fn (ref: Any, opts: Map): Map

GET a drive by reference: "me", a drive id, or a base path from ::microsoft::onedrive/user-drive, site-drive, group-drive. opts takes select and credentials.

mine ::microsoft::onedrive::drives/get-drive("me")
mine.driveType   // "business" or "personal"
lib ::microsoft::onedrive::drives/get-drive(::microsoft::onedrive/site-drive(site-id))

group-drive

fn (group-id: Str): Map
fn (group-id: Str, opts: Map): Map

GET /groups/{id}/drive - a Microsoft 365 group's or team's document library.

list-drives-at

fn (owner-path: Str): Vec
fn (owner-path: Str, opts: Map): Vec

GET {owner}/drives - the drives of "/me", "/users/{id}", "/sites/{id}" or "/groups/{id}", all pages.

my-drive

fn (): Map
fn (opts: Map): Map

GET /me/drive - the signed-in user's OneDrive (delegated tokens only).

site-drives

fn (site-id: Str): Vec
fn (site-id: Str, opts: Map): Vec

GET /sites/{id}/drives - a SharePoint site's document libraries (each a drive). See also ::microsoft::sharepoint::sites/list-drives.

user-drive

fn (user: Str): Map
fn (user: Str, opts: Map): Map

GET /users/{id}/drive - a user's OneDrive (app-only needs Files.Read.All). The user must have signed in to OneDrive once for it to exist.