pub struct CreateRequest { /* private fields */ }Expand description
A request builder to create a permission for a file or shared drive.
Implementations§
Source§impl CreateRequest
impl CreateRequest
Sourcepub fn new(credentials: &Credentials, file_id: impl AsRef<str>) -> Self
pub fn new(credentials: &Credentials, file_id: impl AsRef<str>) -> Self
Creates a new CreateRequest builder, authorized with the given Credentials.
Sourcepub fn execute(&self) -> Result<Permission>
pub fn execute(&self) -> Result<Permission>
Executes this request.
§Errors:
- a
UrlParsingerror, if the creation of the request’s URL failed. - a
Requesterror, if unable to send the request or get a body from the response. - a
Responseerror, if the request returned an error response. - a
Jsonerror, if unable to parse the response’s body to into the return type.
Sourcepub fn fields<T>(self, value: T) -> Self
pub fn fields<T>(self, value: T) -> Self
You can set this parameter to return the exact fields you need, and improve performance in your method call.
§Note:
By default, the server sends back a set of fields specific to the resource being queried. For example, the files.get method might only return the id, name, and mimeType for the files resource. The permissions.get method returns a different set of default fields for a permissions resource.
See Google’s documentation
Sourcepub fn email_message<T>(self, value: T) -> Self
pub fn email_message<T>(self, value: T) -> Self
A plain text custom message to include in the notification email.
Sourcepub fn move_to_new_owners_root<T>(self, value: T) -> Self
pub fn move_to_new_owners_root<T>(self, value: T) -> Self
This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item.
If set to true, the item will be moved to the new owner’s My Drive
root folder and all prior parents removed. If set to false,
parents are not changed.
Sourcepub fn send_notification_email<T>(self, value: T) -> Self
pub fn send_notification_email<T>(self, value: T) -> Self
Whether to send a notification email when sharing to users or groups.
This defaults to true for users and groups, and is not allowed for
other requests. It must not be disabled for ownership transfers.
Sourcepub fn supports_all_drives<T>(self, value: T) -> Self
pub fn supports_all_drives<T>(self, value: T) -> Self
Whether the requesting application supports both My Drives and shared drives.
Sourcepub fn transfer_ownership<T>(self, value: T) -> Self
pub fn transfer_ownership<T>(self, value: T) -> Self
Whether to transfer ownership to the specified user and downgrade the current owner to a writer.
This parameter is required as an acknowledgement of the side effect.
Sourcepub fn use_domain_admin_access<T>(self, value: T) -> Self
pub fn use_domain_admin_access<T>(self, value: T) -> Self
Issue the request as a domain administrator.
if set to true, then the requester will be granted access if they
are an administrator of the domain to which the shared drive
belongs.
Sourcepub fn permission<T>(self, value: T) -> Selfwhere
T: Into<Permission>,
pub fn permission<T>(self, value: T) -> Selfwhere
T: Into<Permission>,
The permission which will be applied.
Trait Implementations§
Source§impl Clone for CreateRequest
impl Clone for CreateRequest
Source§fn clone(&self) -> CreateRequest
fn clone(&self) -> CreateRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more