MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / getDocument

Function getDocument

document-warehouse/get-document.js:47–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45
46 // Get Document Schema
47 async function getDocument() {
48 // Initialize request argument(s)
49 const documentRequest = {
50 // The full resource name of the document, e.g.:
51 // projects/{project_number}/locations/{location}/documents/{document_id}
52 name: serviceClient.projectLocationDocumentPath(
53 projectNumber,
54 location,
55 documentId
56 ),
57 requestMetadata: {userInfo: {id: userId}},
58 };
59
60 // Make Request
61 const response = serviceClient.getDocument(documentRequest);
62
63 // Print out response
64 response.then(
65 result => console.log(`Document Found: ${JSON.stringify(result)}`),
66 error => console.log(`${error}`)
67 );
68 }
69
70 // [END contentwarehouse_get_document]
71 await getDocument();

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected