-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathapply.js
45 lines (38 loc) · 1.01 KB
/
apply.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
41
42
43
44
45
'use strict';
const BoxCommand = require('../../box-command');
class WatermarkingApplyCommand extends BoxCommand {
async run() {
const { flags, args } = this.parse(WatermarkingApplyCommand);
let watermark;
if (args.itemType === 'file') {
watermark = await this.client.files.applyWatermark(args.itemID);
} else if (args.itemType === 'folder') {
watermark = await this.client.folders.applyWatermark(args.itemID);
}
await this.output(watermark);
}
}
WatermarkingApplyCommand.description = 'Apply a watermark on an item';
WatermarkingApplyCommand.examples = ['box watermarking:apply folder 22222'];
WatermarkingApplyCommand.flags = {
...BoxCommand.flags
};
WatermarkingApplyCommand.args = [
{
name: 'itemType',
required: true,
hidden: false,
description: 'Type of item to apply a watermark to',
options: [
'file',
'folder'
],
},
{
name: 'itemID',
required: true,
hidden: false,
description: 'ID of the item to apply a watermark to'
}
];
module.exports = WatermarkingApplyCommand;