The files
resource, which is returned by the files.list
and other methods, includes a list of parents for each file. It would be extremely helpful if files
also included some indication of children. An integer property with the count of children would be best, but a Boolean flag indicating whether children exist would be fine. Could that be added to the API, Google folks?
I ask because I'm writing an application that displays an expandable tree of the user's Google Drive contents. The tree initially displays the top level of their drive with all folders collapsed. As the user expands folders, new queries are sent to the GD API to get the contents of each one. However, empty folders are to be displayed without an expansion icon at all. In order to do that, as the list of children in a folder is processed, if a child is a folder, another query must be run for that specific folder to discover whether it has children. It would be so much better if the files
resource included a count of its children or a flag indicating their existence. It would reduce the number of queries, network traffic, and processing time.