-
Notifications
You must be signed in to change notification settings - Fork 662
/
usergroups.users.js
56 lines (46 loc) · 1.81 KB
/
usergroups.users.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
46
47
48
49
50
51
52
53
54
55
56
/**
* API Facet to make calls to methods in the usergroups.users namespace.
*
* This provides functions to call:
* - list: {@link https://api.slack.com/methods/usergroups.users.list|usergroups.users.list}
* - update: {@link https://api.slack.com/methods/usergroups.users.update|usergroups.users.update}
*
*/
function UsergroupsUsersFacet(makeAPICall) {
this.name = 'usergroups.users';
this.makeAPICall = makeAPICall;
}
/**
* List all users in a User Group
* @see {@link https://api.slack.com/methods/usergroups.users.list|usergroups.users.list}
*
* @param {?} usergroup - The encoded ID of the User Group to update.
* @param {Object=} opts
* @param {?} opts.include_disabled - Allow results that involve disabled User Groups.
* @param {function=} optCb Optional callback, if not using promises.
*/
UsergroupsUsersFacet.prototype.list = function list(usergroup, opts, optCb) {
var requiredArgs = {
usergroup: usergroup
};
return this.makeAPICall('usergroups.users.list', requiredArgs, opts, optCb);
};
/**
* Update the list of users for a User Group
* @see {@link https://api.slack.com/methods/usergroups.users.update|usergroups.users.update}
*
* @param {?} usergroup - The encoded ID of the User Group to update.
* @param {?} users - A comma separated string of encoded user IDs that represent the entire list
* of users for the User Group.
* @param {Object=} opts
* @param {?} opts.include_count - Include the number of users in the User Group.
* @param {function=} optCb Optional callback, if not using promises.
*/
UsergroupsUsersFacet.prototype.update = function update(usergroup, users, opts, optCb) {
var requiredArgs = {
usergroup: usergroup,
users: users
};
return this.makeAPICall('usergroups.users.update', requiredArgs, opts, optCb);
};
module.exports = UsergroupsUsersFacet;