-
Notifications
You must be signed in to change notification settings - Fork 8
/
Conferences.gs
44 lines (34 loc) · 1.48 KB
/
Conferences.gs
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
/**
@module resources/Conferences
The Twilio "Conferences" Resource.
*/
//var generate = require('./generate');
var Conferences_ = function (client, accountSid) {
var baseResourceUrl = '/Accounts/' + accountSid + '/Conferences';
//Instance requests
function Conferences(sid) {
var resourceApi = {
get:generate_(client, 'GET', baseResourceUrl + '/' + sid)
};
//Add in subresources
resourceApi.participants = function(participantSid) {
var participantResourceApi = {
get:generate_(client, 'GET', baseResourceUrl + '/' + sid + '/Participants/' + participantSid),
post:generate_(client, 'POST', baseResourceUrl + '/' + sid + '/Participants/' + participantSid),
'delete':generate_(client, 'DELETE', baseResourceUrl + '/' + sid + '/Participants/' + participantSid)
};
//Aliases
participantResourceApi.update = participantResourceApi.post;
participantResourceApi.kick = participantResourceApi['delete'];
return participantResourceApi;
};
resourceApi.participants.get = generate_(client, 'GET', baseResourceUrl + '/' + sid + '/Participants');
//Aliases
resourceApi.participants.list = resourceApi.participants.get;
return resourceApi;
}
//List requests
Conferences.get = generate_(client, 'GET', baseResourceUrl);
Conferences.list = Conferences.get;
return Conferences;
};