def ListFiles(self): args = vfs_pb2.ApiListFilesArgs(client_id=self.client_id, file_path=self.path) items = self._context.SendIteratorRequest("ListFiles", args) def MapDataToFile(data): return File(client_id=self.client_id, data=data, context=self._context) return utils.MapItemsIterator(MapDataToFile, items)
def ListFiles(self) -> utils.ItemsIterator["File"]: """Lists files under the directory.""" args = vfs_pb2.ApiListFilesArgs( client_id=self.client_id, file_path=self.path) items = self._context.SendIteratorRequest("ListFiles", args) def MapDataToFile(data: message.Message) -> "File": if not isinstance(data, vfs_pb2.ApiFile): raise TypeError(f"Unexpected response type: {type(data)}") return File(client_id=self.client_id, data=data, context=self._context) return utils.MapItemsIterator(MapDataToFile, items)