pub struct RevisionMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on revision resources.
It is not used directly, but through the DriveHub hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_drive2 as drive2;
use drive2::{DriveHub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_only()
.enable_http2()
.build();
let executor = hyper_util::rt::TokioExecutor::new();
let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
yup_oauth2::client::CustomHyperClientBuilder::from(
hyper_util::client::legacy::Client::builder(executor).build(connector),
),
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http2()
.build()
);
let mut hub = DriveHub::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)`
// to build up your call.
let rb = hub.revisions();Implementations§
Source§impl<'a, C> RevisionMethods<'a, C>
impl<'a, C> RevisionMethods<'a, C>
Sourcepub fn delete(
&self,
file_id: &str,
revision_id: &str,
) -> RevisionDeleteCall<'a, C>
pub fn delete( &self, file_id: &str, revision_id: &str, ) -> RevisionDeleteCall<'a, C>
Create a builder to help you perform the following task:
Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can’t be deleted.
§Arguments
fileId- The ID of the file.revisionId- The ID of the revision.
Sourcepub fn get(&self, file_id: &str, revision_id: &str) -> RevisionGetCall<'a, C>
pub fn get(&self, file_id: &str, revision_id: &str) -> RevisionGetCall<'a, C>
Create a builder to help you perform the following task:
Gets a specific revision.
§Arguments
fileId- The ID of the file.revisionId- The ID of the revision.
Sourcepub fn list(&self, file_id: &str) -> RevisionListCall<'a, C>
pub fn list(&self, file_id: &str) -> RevisionListCall<'a, C>
Create a builder to help you perform the following task:
Lists a file’s revisions. Important: The list of revisions returned by this method might be incomplete for files with a large revision history, including frequently edited Google Docs, Sheets, and Slides. Older revisions might be omitted from the response, meaning the first revision returned may not be the oldest existing revision. The revision history visible in the Workspace editor user interface might be more complete than the list returned by the API.
§Arguments
fileId- The ID of the file.
Sourcepub fn patch(
&self,
request: Revision,
file_id: &str,
revision_id: &str,
) -> RevisionPatchCall<'a, C>
pub fn patch( &self, request: Revision, file_id: &str, revision_id: &str, ) -> RevisionPatchCall<'a, C>
Create a builder to help you perform the following task:
Updates a revision.
§Arguments
request- No description provided.fileId- The ID for the file.revisionId- The ID for the revision.
Sourcepub fn update(
&self,
request: Revision,
file_id: &str,
revision_id: &str,
) -> RevisionUpdateCall<'a, C>
pub fn update( &self, request: Revision, file_id: &str, revision_id: &str, ) -> RevisionUpdateCall<'a, C>
Create a builder to help you perform the following task:
Updates a revision.
§Arguments
request- No description provided.fileId- The ID for the file.revisionId- The ID for the revision.