pub struct PermissionMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on permission 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_drive3 as drive3;
use drive3::{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 `create(...)`, `delete(...)`, `get(...)`, `list(...)` and `update(...)`
// to build up your call.
let rb = hub.permissions();Implementations§
Source§impl<'a, C> PermissionMethods<'a, C>
impl<'a, C> PermissionMethods<'a, C>
Sourcepub fn create(
&self,
request: Permission,
file_id: &str,
) -> PermissionCreateCall<'a, C>
pub fn create( &self, request: Permission, file_id: &str, ) -> PermissionCreateCall<'a, C>
Create a builder to help you perform the following task:
Creates a permission for a file or shared drive. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren’t supported; only the last update is applied.
§Arguments
request- No description provided.fileId- The ID of the file or shared drive.
Sourcepub fn delete(
&self,
file_id: &str,
permission_id: &str,
) -> PermissionDeleteCall<'a, C>
pub fn delete( &self, file_id: &str, permission_id: &str, ) -> PermissionDeleteCall<'a, C>
Create a builder to help you perform the following task:
Deletes a permission. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren’t supported; only the last update is applied.
§Arguments
fileId- The ID of the file or shared drive.permissionId- The ID of the permission.
Sourcepub fn get(
&self,
file_id: &str,
permission_id: &str,
) -> PermissionGetCall<'a, C>
pub fn get( &self, file_id: &str, permission_id: &str, ) -> PermissionGetCall<'a, C>
Create a builder to help you perform the following task:
Gets a permission by ID. For more information, see Share files, folders, and drives.
§Arguments
fileId- The ID of the file.permissionId- The ID of the permission.
Sourcepub fn list(&self, file_id: &str) -> PermissionListCall<'a, C>
pub fn list(&self, file_id: &str) -> PermissionListCall<'a, C>
Create a builder to help you perform the following task:
Lists a file’s or shared drive’s permissions. For more information, see Share files, folders, and drives.
§Arguments
fileId- The ID of the file or shared drive.
Sourcepub fn update(
&self,
request: Permission,
file_id: &str,
permission_id: &str,
) -> PermissionUpdateCall<'a, C>
pub fn update( &self, request: Permission, file_id: &str, permission_id: &str, ) -> PermissionUpdateCall<'a, C>
Create a builder to help you perform the following task:
Updates a permission with patch semantics. For more information, see Share files, folders, and drives. Warning: Concurrent permissions operations on the same file aren’t supported; only the last update is applied.
§Arguments
request- No description provided.fileId- The ID of the file or shared drive.permissionId- The ID of the permission.