pub struct Drives { /* private fields */ }Expand description
Information of a shared drive.
Some resource methods (such as drives.update) require a
drive_id. Use the drives.list method to retrieve the ID
for a shared drive.
§Examples
List the shared Drives of a user
let drive_list = drive.drives.list()
.page_size(10)
.q("name = 'drive_im_looking_for'") // search for specific drives
.execute()?;
if let Some(drives) = drive_list.drives {
for drive in drives {
println!("{}", drive);
}
}Implementations§
Source§impl Drives
impl Drives
Sourcepub fn new(credentials: &Credentials) -> Self
pub fn new(credentials: &Credentials) -> Self
Creates a new Drives resource with the given Credentials.
Sourcepub fn create(&self) -> CreateRequest
pub fn create(&self) -> CreateRequest
Creates a shared drive.
See Google’s documentation for more information.
§Requires the following OAuth scope:
https://www.googleapis.com/auth/drive
§Examples:
use drive_v3::objects::DriveInfo;
let drive_info = DriveInfo {
name: Some( "drive-name".to_string() ),
..Default::default()
};
let created_drive = drive.drives.create()
.drive_info(&drive_info)
.execute()?;
assert_eq!(created_drive.name, drive_info.name);Sourcepub fn delete<T: AsRef<str>>(&self, drive_id: T) -> DeleteRequest
pub fn delete<T: AsRef<str>>(&self, drive_id: T) -> DeleteRequest
Permanently deletes a shared drive for which the user is an organizer.
The shared drive cannot contain any untrashed items.
See Google’s documentation for more information.
§Requires the following OAuth scope:
https://www.googleapis.com/auth/drive
§Examples:
let drive_id = "some-drive-id";
let response = drive.drives.delete(&drive_id).execute();
assert!( response.is_ok() );Sourcepub fn get<T: AsRef<str>>(&self, drive_id: T) -> GetRequest
pub fn get<T: AsRef<str>>(&self, drive_id: T) -> GetRequest
Gets a shared drive’s metadata by ID.
See Google’s documentation for more information.
§Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.readonly
§Examples:
let drive_id = "some-drive-id";
let drive_info = drive.drives.get(&drive_id).execute()?;
println!("This is the Drive's information:\n{}", drive_info);Sourcepub fn hide<T: AsRef<str>>(&self, drive_id: T) -> HideRequest
pub fn hide<T: AsRef<str>>(&self, drive_id: T) -> HideRequest
Hides a shared drive from the default view.
See Google’s documentation for more information.
§Requires the following OAuth scope:
https://www.googleapis.com/auth/drive
§Examples:
let drive_id = "some-drive-id";
let drive_info = drive.drives.hide(&drive_id).execute()?;
assert!( drive_info.hidden.unwrap() );Sourcepub fn list(&self) -> ListRequest
pub fn list(&self) -> ListRequest
Lists the user’s shared drives.
See Google’s documentation for more information.
§Note:
This method accepts the q parameter, which is a
search query combining one or more search terms. For more information,
see Google’s
Search for shared drives
guide.
§Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.readonly
§Examples:
let drive_list = drive.drives.list()
.page_size(10)
.q("name = 'drive_im_looking_for'") // search for specific drives
.execute()?;
if let Some(drives) = drive_list.drives {
for drive in drives {
println!("{}", drive);
}
}Sourcepub fn unhide<T: AsRef<str>>(&self, drive_id: T) -> UnhideRequest
pub fn unhide<T: AsRef<str>>(&self, drive_id: T) -> UnhideRequest
Restores a shared drive to the default view.
See Google’s documentation for more information.
§Requires the following OAuth scope:
https://www.googleapis.com/auth/drive
§Examples:
let drive_id = "some-drive-id";
let drive_info = drive.drives.unhide(&drive_id).execute()?;
assert!( !drive_info.hidden.unwrap() );Sourcepub fn update<T: AsRef<str>>(&self, drive_id: T) -> UpdateRequest
pub fn update<T: AsRef<str>>(&self, drive_id: T) -> UpdateRequest
Updates the metadata for a shared drive.
See Google’s documentation for more information.
§Requires the following OAuth scope:
https://www.googleapis.com/auth/drive
§Examples:
use drive_v3::objects::DriveInfo;
let updated_drive_info = DriveInfo {
name: Some( "updated-drive-name".to_string() ),
..Default::default()
};
let drive_id = "some-drive-id";
let drive_info = drive.drives.update(&drive_id)
.drive_info(&updated_drive_info)
.execute()?;
assert_eq!(drive_info.name, updated_drive_info.name);Trait Implementations§
impl Eq for Drives
impl StructuralPartialEq for Drives
Auto Trait Implementations§
impl Freeze for Drives
impl RefUnwindSafe for Drives
impl Send for Drives
impl Sync for Drives
impl Unpin for Drives
impl UnwindSafe for Drives
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.