With file uploaded and file_id
known:
media_body = MediaFileUpload(filepath, mimetype=mimetype)
body = {'name': os.path.basename(filepath), 'appProperties':{'my_key': 'my_value'}}
file = drive_service.files().create(body=body, media_body=media_body, fields='id, appProperties').execute()
file_id = file['id']
How to modify the file's appProperties
using v3?
There is a Google Drive API v3 Migration post that could be used to get some idea on things not covered in the documentaion. This post's Trash / Update section talks about update
functionality in Google Drive API v3.
But it is written in Java and not Python. It suggests of using an empty File object: File newContent = new File();
Another post this time for PHP mentions about update
method and this empty File approach too: How to update file in google drive v3 PHP
I would appreciate if someone here would trough a couple of Python snippets to guide me in a right direction.