-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathgroups.js
38 lines (29 loc) · 883 Bytes
/
groups.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
'use strict';
const BoxCommand = require('../../box-command');
class UsersListGroupsCommand extends BoxCommand {
async run() {
const { flags, args } = this.parse(UsersListGroupsCommand);
let options = {};
if (flags.fields) {
options.fields = flags.fields;
}
let groups = await this.client.users.getGroupMemberships(args.id, options);
await this.output(groups);
}
}
UsersListGroupsCommand.aliases = [ 'users:list-groups' ];
UsersListGroupsCommand.description = 'List groups a user belongs to';
UsersListGroupsCommand.examples = ['box users:groups 33333'];
UsersListGroupsCommand._endpoint = 'get_users_id_memberships';
UsersListGroupsCommand.flags = {
...BoxCommand.flags
};
UsersListGroupsCommand.args = [
{
name: 'id',
required: true,
hidden: false,
description: 'ID of the user to get groups for',
}
];
module.exports = UsersListGroupsCommand;