Crate onedrive_api
source ·Expand description
§onedrive-api
onedrive-api
crate provides middle-level HTTP APIs OneDrive
to the
OneDrive API through Microsoft Graph, and also Auth
with utilities for OAuth2.
§Example
use onedrive_api::{OneDrive, FileName, DriveLocation, ItemLocation};
use reqwest::Client;
let client = Client::new();
let drive = OneDrive::new(
"<...TOKEN...>", // Login token to Microsoft Graph.
DriveLocation::me(),
);
let folder_item = drive
.create_folder(
ItemLocation::root(),
FileName::new("test_folder").unwrap(),
)
.await?;
drive
.upload_small(
folder_item.id.as_ref().unwrap(),
&b"Hello, world"[..],
)
.await?;
§Features
-
beta
Most of Microsoft APIs used in this crate are stable. But there are also some beta APIs, which are subject to change and is not suggested to be used in production application. Microsoft references of beta APIs usually contain a
(beta)
suffix in title.To avoid breakage, we put beta APIs and related resources under feature gate
beta
. They may change to follow Microsoft API references ANYTIME, and do NOT follow the semantic version of this crate.Be carefully using it and do NOT use it in production.
Re-exports§
Modules§
- Configurable options which can be used to customize API behaviors or responses.
- Resource Objects defined in the OneDrive API.
Structs§
- OAuth2 authentication and authorization basics for Microsoft Graph.
- The progress of a asynchronous
copy
operation. (Beta) - The monitor for checking the progress of a asynchronous
copy
operation. - Specify the location of a
Drive
resource. - Error of API request
- A half-open byte range
start..end
orstart..
. - An valid file name str (unsized).
- Reference to a
DriveItem
in a drive. It does not contains the drive information. - The page fetcher for listing children
- The authorized client to access OneDrive resources in a specified Drive.
- A list of the Microsoft Graph permissions that you want the user to consent to.
- Tokens and some additional data returned by a successful authorization.
- The page fetcher for tracking operations with
Iterator
interface. - An upload session for resumable file uploading process.
- Metadata of an in-progress upload session
Enums§
- Credential of client for code redeemption.
- The conflict resolution behavior for actions that create a new item.
- The status of a
copy
operation. (Beta) - Control who can sign into the application.
Type Aliases§
- An alias to
Result
ofError
.