Module onedrive_api::resource

source ·
Expand description

Resource Objects defined in the OneDrive API.

§Field descriptors

Resource object structs have field descriper enums representing all controlable fields of it, which may be used in onedrive_api::option to select or expand it using with_option version API of OneDrive.

§Example

Here is an example to use resource::DriveItemField.

use onedrive_api::{OneDrive, ItemLocation, option::ObjectOption};
use onedrive_api::resource::*;

// let drive: OneDrive;
let item: Option<DriveItem> = drive
    .get_item_with_option(
        ItemLocation::root(),
        ObjectOption::new()
            .if_none_match(&Tag("<abcdABCD1234>".to_owned()))
            // Only response `id` and `e_tag` to reduce data transmission.
            .select(&[DriveItemField::id, DriveItemField::e_tag]),
    )
    .await?;
match item {
    None => println!("Tag matched"),
    Some(item) => {
        println!("id: {:?}, e_tag: {:?}", item.id.unwrap(), item.e_tag.unwrap());
    }
}

§See also

Microsoft Docs

Structs§

  • Drive resource type
  • Wrapper for a unique identifier to a Drive.
  • DriveItem resource type
  • The error resource type, returned whenever an error occurs in the processing of a request.
  • Wrapper for a unique identifier for a DriveItem.
  • OAuth2 error response.
  • Wrapper for a tag representing the state of an item.

Enums§

Type Aliases§

  • Boxed raw json value.
  • Timestamp string with ISO 8601 format.
  • A semantic alias for URL string in resource objects.