-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathUsageRecords.gs
66 lines (52 loc) · 1.56 KB
/
UsageRecords.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
@module resources/UsageRecords
The Twilio "Usage/Records" Resource.
*/
//var generate = require('./generate'),
// ListInstanceResource = require('./ListInstanceResource');
var UsageRecords_ = function (client, accountSid) {
var baseResourceUrl = '/Accounts/' + accountSid + '/Usage/Records';
//Instance requests
function Records(id) {
var resourceApi = {};
//Add standard instance resource functions
generate_.restFunctions(resourceApi,client,['GET'], baseResourceUrl + '/' + id);
return resourceApi;
}
//There are special shorthand methods for specific date ranges:
Records.daily = {
get: Records('Daily').get,
list: Records('Daily').get
};
Records.monthly = {
get: Records('Monthly').get,
list: Records('Monthly').get
};
Records.yearly = {
get: Records('Yearly').get,
list: Records('Yearly').get
};
Records.allTime = {
get: Records('AllTime').get,
list: Records('AllTime').get
};
Records.today = {
get: Records('Today').get,
list: Records('Today').get
};
Records.yesterday = {
get: Records('Yesterday').get,
list: Records('Yesterday').get
};
Records.thisMonth = {
get: Records('ThisMonth').get,
list: Records('ThisMonth').get
};
Records.lastMonth = {
get: Records('LastMonth').get,
list: Records('LastMonth').get
};
//List requests
generate_.restFunctions(Records, client, ['GET'], baseResourceUrl);
return Records;
};