| 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(); |