You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It would be nice to be able to trash a spreadsheet instead of fully deleting it. The following code shows how to do it when using API v3. There's no rush on this, but we are implementing this ourselves, and I thought it would be good to share. Thanks!
Describe the solution you'd like
deftrash_spreadsheet(client, file_id: str):
"""Trash a spreadsheet. Args: file_id: The id of the spreadsheet to trash. Returns: The updated file metadata. """# First retrieve the file from the API.file=client.drive.service.files().get(fileId=file_id, fields="trashed", supportsAllDrives=True).execute()
# File's new metadata.file['trashed'] =True# Send the request to the API.updated_file=client.drive.service.files().update(fileId=file_id, body=file, supportsAllDrives=True).execute()
returnupdated_file
Any other info
Any other info
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It would be nice to be able to trash a spreadsheet instead of fully deleting it. The following code shows how to do it when using API v3. There's no rush on this, but we are implementing this ourselves, and I thought it would be good to share. Thanks!
Describe the solution you'd like
Any other info
Any other info
The text was updated successfully, but these errors were encountered: