-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathget.js
40 lines (33 loc) · 1.11 KB
/
get.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
const BoxCommand = require('../../../box-command');
const { flags } = require('@oclif/command');
class FoldersGetMetadataCommand extends BoxCommand {
async run() {
const { flags, args } = this.parse(FoldersGetMetadataCommand);
let metadata = await this.client.folders.getMetadata(args.id, flags.scope, flags['template-key']);
await this.output(metadata);
}
}
FoldersGetMetadataCommand.description = 'Get information about a metadata object';
FoldersGetMetadataCommand.examples = ['box folders:metadata:get 22222 --template-key employeeRecord'];
FoldersGetMetadataCommand._endpoint = 'get_folders_id_metadata_id_id';
FoldersGetMetadataCommand.flags = {
...BoxCommand.flags,
scope: flags.string({
description: 'The scope of the metadata template to retrieve',
default: 'enterprise',
}),
'template-key': flags.string({
description: 'The key of the metadata template to retrieve',
required: true,
}),
};
FoldersGetMetadataCommand.args = [
{
name: 'id',
required: true,
hidden: false,
description: 'ID of the folder to get metadata on',
}
];
module.exports = FoldersGetMetadataCommand;