update_document


Description:

[ Version ( since = "0.8.0" ) ]
public UploadStream update_document (DocumentsDocument document, string slug, string content_type, Cancellable? cancellable = null) throws Error

Update the document using the properties from document and the document data written to the resulting UploadStream.

If the document data does not need to be changed, just the metadata, use update_entry instead.

This performs a non-resumable upload, unlike update_document. This means that errors during transmission will cause the upload to fail, and the entire document will have to be re-uploaded. It is recommended that update_document_resumable be used instead.

The stream returned by this function should be written to using the standard OutputStream methods, asynchronously or synchronously. Once the stream is closed (using close), finish_upload should be called on it to parse and return the updated DocumentsDocument for the document. This must be done, as document isn't updated in-place.

In order to cancel the update, a Cancellable passed in to cancellable must be cancelled using cancel. Cancelling the individual OutputStream operations on the UploadStream will not cancel the entire update; merely the write or close operation in question. See the cancellable for more details.

Any upload errors will be thrown by the stream methods, and may come from the ServiceError domain.

For more information, see update_entry.

Parameters:

this

a DocumentsService

document

the DocumentsDocument to update

slug

the filename to give to the uploaded document

content_type

the content type of the uploaded data

cancellable

a Cancellable for the entire upload stream, or null

Returns:

a UploadStream to write the document data to; unref with unref