pub struct DriveFileUrlBuilder<C> { /* private fields */ }Expand description
Builder for the build_file_from_url method.
Implementations§
Source§impl<C> DriveFileUrlBuilder<C>
impl<C> DriveFileUrlBuilder<C>
Sourcepub fn with_url(client: C, url: Url) -> Self
pub fn with_url(client: C, url: Url) -> Self
Creates a builder with the client and URL of the upload source.
Sourcepub fn as_request(&self) -> &Request
pub fn as_request(&self) -> &Request
Gets the request object for reuse.
Sourcepub fn folder(&mut self, folder: impl EntityRef<DriveFolder>) -> &mut Self
pub fn folder(&mut self, folder: impl EntityRef<DriveFolder>) -> &mut Self
Sets the parent folder of the file.
Sourcepub fn comment(&mut self, comment: impl Into<String>) -> &mut Self
Available on crate feature 12-48-0 only.
pub fn comment(&mut self, comment: impl Into<String>) -> &mut Self
12-48-0 only.Sets the comment for the file.
Sourcepub fn sensitive(&mut self, sensitive: bool) -> &mut Self
pub fn sensitive(&mut self, sensitive: bool) -> &mut Self
Sets whether the file contains NSFW content.
Sourcepub fn use_existing_if_uploaded(
&mut self,
use_existing_if_uploaded: bool,
) -> &mut Self
pub fn use_existing_if_uploaded( &mut self, use_existing_if_uploaded: bool, ) -> &mut Self
Sets whether or not to upload the file again even if the same content has already been uploaded.
Source§impl<C: Client> DriveFileUrlBuilder<C>
impl<C: Client> DriveFileUrlBuilder<C>
Sourcepub async fn upload(&self) -> Result<(), Error<C::Error>>
Available on crate feature 12-48-0 only.
pub async fn upload(&self) -> Result<(), Error<C::Error>>
12-48-0 only.Uploads the file.
The difference between upload_ and this method is that the former
can get the DriveFile of the uploaded file, while the latter cannot.
If you want to obtain the DriveFile of an uploaded file in v12.48.0 or later, you can
use upload_and_wait or download the file once on the client side
and the use UploadFileClientExt::upload_file to upload it.
Source§impl<C> DriveFileUrlBuilder<C>
impl<C> DriveFileUrlBuilder<C>
Sourcepub async fn upload_and_wait(
&self,
) -> Result<DriveFile, Error<<C as Client>::Error>>
Available on crate feature 12-48-0 only.
pub async fn upload_and_wait( &self, ) -> Result<DriveFile, Error<<C as Client>::Error>>
12-48-0 only.Uploads the file and wait for a message of completion from the server.
Unlike upload, this method returns DriveFile.
§Note on the use of main stream
This method is implemented by waiting for the upload completion event in the main stream. However, it is currently not possible to have multiple connections to the main stream from the same client. Therefore, when you use this method, you must not not be connected to the main stream elsewhere. Likewise, you will not be able to connect to the main stream until this method is completed.