def action(): get_service(credentials).files().update( fileId=file['id'], body={ 'modifiedTime': datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%S" + 'Z') }).execute()
def action(): folder = get_service(credentials).files().create( body={ 'name': name, 'parents': [parent['id']], 'mimeType': 'application/vnd.google-apps.folder' }, fields='id').execute() folder['path'] = path folder['name'] = name return folder
def load_page(): if name_filter: q = "'{0}' in parents and name = '{1}'".format(folder['id'], name_filter) else: q = "'{0}' in parents".format(folder['id']) request = get_service(credentials).files().list( q=q, fields="nextPageToken, files(id, name, size, mimeType, modifiedTime)", pageSize=PAGE_SIZE, pageToken=acc.get('nextPageToken') ) return request.execute()
def create_downloader(): request = get_service(credentials).files().get_media( fileId=f['id']) return MediaIoBaseDownload(fd=destination_file, request=request, chunksize=CHUNK_SIZE)
def action(): get_service(credentials).files().delete(fileId=file['id']).execute()