MCPcopy Index your code
hub / github.com/googleapis/google-api-python-client / document_collection_recursive

Function document_collection_recursive

scripts/describe.py:360–391  ·  view source on GitHub ↗
(
    resource,
    path,
    root_discovery,
    discovery,
    doc_destination_dir,
    artifact_destination_dir=DISCOVERY_DOC_DIR,
)

Source from the content-addressed store, hash-verified

358
359
360def document_collection_recursive(
361 resource,
362 path,
363 root_discovery,
364 discovery,
365 doc_destination_dir,
366 artifact_destination_dir=DISCOVERY_DOC_DIR,
367):
368 html = document_collection(resource, path, root_discovery, discovery)
369
370 f = open(pathlib.Path(doc_destination_dir).joinpath(path + "html"), "w")
371
372 f.write(html)
373 f.close()
374
375 for name in dir(resource):
376 if (
377 not name.startswith("_")
378 and callable(getattr(resource, name))
379 and hasattr(getattr(resource, name), "__is_resource__")
380 and discovery != {}
381 ):
382 dname = name.rsplit("_")[0]
383 collection = getattr(resource, name)()
384 document_collection_recursive(
385 collection,
386 path + name + ".",
387 root_discovery,
388 discovery["resources"].get(dname, {}),
389 doc_destination_dir,
390 artifact_destination_dir,
391 )
392
393
394def document_api(

Callers 2

document_apiFunction · 0.70

Calls 3

document_collectionFunction · 0.70
closeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…