-
Notifications
You must be signed in to change notification settings - Fork 662
/
files.comments.js
74 lines (61 loc) · 2.13 KB
/
files.comments.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* API Facet to make calls to methods in the files.comments namespace.
*
* This provides functions to call:
* - add: {@link https://api.slack.com/methods/files.comments.add|files.comments.add}
* - delete: {@link https://api.slack.com/methods/files.comments.delete|files.comments.delete}
* - edit: {@link https://api.slack.com/methods/files.comments.edit|files.comments.edit}
*
*/
function FilesCommentsFacet(makeAPICall) {
this.name = 'files.comments';
this.makeAPICall = makeAPICall;
}
/**
* Add a comment to an existing file.
* @see {@link https://api.slack.com/methods/files.comments.add|files.comments.add}
*
* @param {?} file - File to add a comment to.
* @param {?} comment - Text of the comment to add.
* @param {function=} optCb Optional callback, if not using promises.
*/
FilesCommentsFacet.prototype.add = function add(file, comment, optCb) {
var requiredArgs = {
file: file,
comment: comment
};
return this.makeAPICall('files.comments.add', requiredArgs, null, optCb);
};
/**
* Deletes an existing comment on a file.
* @see {@link https://api.slack.com/methods/files.comments.delete|files.comments.delete}
*
* @param {?} file - File to delete a comment from.
* @param {?} id - The comment to delete.
* @param {function=} optCb Optional callback, if not using promises.
*/
FilesCommentsFacet.prototype.delete = function delete_(file, id, optCb) {
var requiredArgs = {
file: file,
id: id
};
return this.makeAPICall('files.comments.delete', requiredArgs, null, optCb);
};
/**
* Edit an existing file comment.
* @see {@link https://api.slack.com/methods/files.comments.edit|files.comments.edit}
*
* @param {?} file - File containing the comment to edit.
* @param {?} id - The comment to edit.
* @param {?} comment - Text of the comment to edit.
* @param {function=} optCb Optional callback, if not using promises.
*/
FilesCommentsFacet.prototype.edit = function edit(file, id, comment, optCb) {
var requiredArgs = {
file: file,
id: id,
comment: comment
};
return this.makeAPICall('files.comments.edit', requiredArgs, null, optCb);
};
module.exports = FilesCommentsFacet;