-
Notifications
You must be signed in to change notification settings - Fork 8
/
Calls.gs
37 lines (27 loc) · 1.05 KB
/
Calls.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
/**
@module resources/Calls
The Twilio "Calls" Resource.
*/
//var generate = require('./generate');
var Calls_ = function (client, accountSid) {
var baseResourceUrl = '/Accounts/' + accountSid + '/Calls';
//Instance requests
function Calls(sid) {
var resourceApi = {};
//Add standard instance resource functions
generate_.restFunctions(resourceApi,client,['GET','POST',{update:'POST'}], baseResourceUrl + '/' + sid);
//Add in subresources
resourceApi.recordings = {
get: generate_(client, 'GET', baseResourceUrl + '/' + sid + '/Recordings')
};
resourceApi.notifications = {
get: generate_(client, 'GET', baseResourceUrl + '/' + sid + '/Notifications')
};
resourceApi.recordings.list = resourceApi.recordings.get;
resourceApi.notifications.list = resourceApi.notifications.get;
return resourceApi;
}
//List requests
generate_.restFunctions(Calls, client, ['GET','POST',{create:'POST'}], baseResourceUrl);
return Calls;
};