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

Function document_api_from_discovery_document

describe.py:463–491  ·  view source on GitHub ↗

Document the given API. Args: discovery_url (str): URI of discovery document. doc_destination_dir (str): relative path where the reference documentation should be saved. artifact_destination_dir (str): relative path where the discovery artifacts should be s

(
    discovery_url, doc_destination_dir, artifact_destination_dir=DISCOVERY_DOC_DIR
)

Source from the content-addressed store, hash-verified

461
462
463def document_api_from_discovery_document(
464 discovery_url, doc_destination_dir, artifact_destination_dir=DISCOVERY_DOC_DIR
465):
466 """Document the given API.
467
468 Args:
469 discovery_url (str): URI of discovery document.
470 doc_destination_dir (str): relative path where the reference
471 documentation should be saved.
472 artifact_destination_dir (str): relative path where the discovery
473 artifacts should be saved.
474 """
475 http = build_http()
476 response, content = http.request(discovery_url)
477 discovery = json.loads(content)
478
479 service = build_from_document(discovery)
480
481 name = discovery["version"]
482 version = safe_version(discovery["version"])
483
484 document_collection_recursive(
485 service,
486 "{}_{}.".format(name, version),
487 discovery,
488 discovery,
489 doc_destination_dir,
490 artifact_destination_dir,
491 )
492
493
494def generate_all_api_documents(

Callers 1

describe.pyFile · 0.70

Calls 5

build_httpFunction · 0.90
build_from_documentFunction · 0.90
safe_versionFunction · 0.70
requestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…