The documentation of the functions DirectoryQuery and DirectoryQueryScope used to construct the data structure used by query_directory (NamespaceApi) does not exist. I had to dig around the REST API Doc to figure out how to use them. It would be great if the python sdk documentation could include this info.