-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathindex.js
37 lines (30 loc) · 978 Bytes
/
index.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
'use strict';
const BoxCommand = require('../../box-command');
const { Flags } = require('@oclif/core');
const PaginationUtils = require('../../pagination-utils');
class DevicePinsListCommand extends BoxCommand {
async run() {
const { flags } = await this.parse(DevicePinsListCommand);
let options = PaginationUtils.handlePagination(flags);
if (flags.direction) {
options.direction = flags.direction;
}
let pins = await this.client.devicePins.getAll(options);
await this.output(pins);
}
}
DevicePinsListCommand.description = 'List all the device pins for your enterprise';
DevicePinsListCommand.examples = ['box device-pins'];
DevicePinsListCommand._endpoint = 'get_enterprises_id_device_pinners';
DevicePinsListCommand.flags = {
...BoxCommand.flags,
...PaginationUtils.flags,
direction: Flags.string({
description: 'Set sorting (by id) direction. Default is ASC',
options: [
'ASC',
'DESC'
]
})
};
module.exports = DevicePinsListCommand;