Struct onedrive_api::client::Client
source · pub struct Client { /* private fields */ }Expand description
The client for requests accessing OneDrive resources.
Implementations§
source§impl Client
impl Client
pub fn new(token: String, refresh_token: Option<String>) -> Self
pub fn get_token(&self) -> &str
pub fn get_refresh_token(&self) -> Option<&str>
sourcepub fn get_drive<'a>(&self, drive: impl Into<DriveLocation<'a>>) -> Result<Drive>
pub fn get_drive<'a>(&self, drive: impl Into<DriveLocation<'a>>) -> Result<Drive>
Get the Drive resource.
See also
https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/drive_get?view=odsp-graph-online
sourcepub fn list_children<'a>(
&self,
drive: impl Into<DriveLocation<'a>>,
item: impl Into<ItemLocation<'a>>,
match_tag: Option<&Tag>
) -> Result<Option<Vec<DriveItem>>>
pub fn list_children<'a>(
&self,
drive: impl Into<DriveLocation<'a>>,
item: impl Into<ItemLocation<'a>>,
match_tag: Option<&Tag>
) -> Result<Option<Vec<DriveItem>>>
List children of a DriveItem resource.
See also
https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_list_children?view=odsp-graph-online
sourcepub fn get_item<'a>(
&self,
drive: impl Into<DriveLocation<'a>>,
item: impl Into<ItemLocation<'a>>,
match_tag: Option<&Tag>
) -> Result<Option<DriveItem>>
pub fn get_item<'a>(
&self,
drive: impl Into<DriveLocation<'a>>,
item: impl Into<ItemLocation<'a>>,
match_tag: Option<&Tag>
) -> Result<Option<DriveItem>>
Get a DriveItem resource.
See also
https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_get?view=odsp-graph-online
sourcepub fn upload_small<'a>(
&self,
drive: impl Into<DriveLocation<'a>>,
item: impl Into<ItemLocation<'a>>,
data: &[u8]
) -> Result<DriveItem>
pub fn upload_small<'a>(
&self,
drive: impl Into<DriveLocation<'a>>,
item: impl Into<ItemLocation<'a>>,
data: &[u8]
) -> Result<DriveItem>
Upload a small file.
See also
https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_put_content?view=odsp-graph-online