pub struct Changes { /* private fields */ }Expand description
A change to a file or shared drive.
§Examples:
List changes in a drive
let drive_id = "some-drive-id";
let page_token = "some-page-token";
let change_list = drive.changes.list()
.page_size(10)
.drive_id(drive_id)
.page_token(page_token)
.execute()?;
if let Some(changes) = change_list.changes {
for change in changes {
println!("{}", change);
}
}Implementations§
Source§impl Changes
impl Changes
Sourcepub fn new(credentials: &Credentials) -> Self
pub fn new(credentials: &Credentials) -> Self
Creates a new Changes resource with the given Credentials.
Sourcepub fn get_start_page_token(&self) -> GetStartPageTokenRequest
pub fn get_start_page_token(&self) -> GetStartPageTokenRequest
Gets the starting pageToken for listing future changes.
The starting page token is used for listing future changes. The page token doesn’t expire.
See Google’s documentation for more information.
§Note:
This request requires you to set the
drive_id and
supports_all_drives
parameters.
§Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.appdatahttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.metadatahttps://www.googleapis.com/auth/drive.metadata.readonlyhttps://www.googleapis.com/auth/drive.photos.readonlyhttps://www.googleapis.com/auth/drive.readonly
§Examples:
let drive_id = "some-drive-id";
let start_page_token = drive.changes.get_start_page_token()
.drive_id(drive_id)
.supports_all_drives(true)
.execute()?;
println!("Your start page token is: {}", start_page_token);Sourcepub fn list(&self) -> ListRequest
pub fn list(&self) -> ListRequest
Lists the changes for a user or shared drive.
See Google’s documentation for more information.
§Note:
This request requires you to set the
drive_id and
page_token
parameters.
§Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.appdatahttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.metadatahttps://www.googleapis.com/auth/drive.metadata.readonlyhttps://www.googleapis.com/auth/drive.photos.readonlyhttps://www.googleapis.com/auth/drive.readonly
§Examples:
let drive_id = "some-drive-id";
let page_token = "some-page-token";
let change_list = drive.changes.list()
.page_size(10)
.drive_id(drive_id)
.page_token(page_token)
.execute()?;
if let Some(changes) = change_list.changes {
for change in changes {
println!("{}", change);
}
}Sourcepub fn watch(&self) -> WatchRequest
pub fn watch(&self) -> WatchRequest
Subscribes to changes for a user.
See Google’s documentation for more information.
§Note:
This request requires you to set the
drive_id and
page_token
parameters.
§Note
In order to subscribe to changes, you must provide a
Channel with an id and an address which is the
one that will receive the notifications. This can be done by creating a
channel using from.
For more informChangesation on channels, see Google’s documentation.
§Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drivehttps://www.googleapis.com/auth/drive.appdatahttps://www.googleapis.com/auth/drive.filehttps://www.googleapis.com/auth/drive.metadatahttps://www.googleapis.com/auth/drive.metadata.readonlyhttps://www.googleapis.com/auth/drive.photos.readonlyhttps://www.googleapis.com/auth/drive.readonly
§Examples:
use drive_v3::objects::Channel;
let channel_id = "my-channel-id";
let channel_address = "https://mydomain.com/channel-notifications";
let channel = Channel::from(&channel_id, &channel_address);
let drive_id = "some-drive-id";
let page_token = "some-page-token";
let created_channel = drive.changes.watch()
.drive_id(drive_id)
.page_token(page_token)
.channel(&channel)
.execute()?;
println!("this is the created channel:\n{}", created_channel);Trait Implementations§
impl Eq for Changes
impl StructuralPartialEq for Changes
Auto Trait Implementations§
impl Freeze for Changes
impl RefUnwindSafe for Changes
impl Send for Changes
impl Sync for Changes
impl Unpin for Changes
impl UnwindSafe for Changes
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.