forked from illiatdesdindes/twilio-gas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IncomingPhoneNumbers.js
24 lines (20 loc) · 1.01 KB
/
IncomingPhoneNumbers.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
/**
@module resources/AvailablePhoneNumbers
The Twilio "AvailablePhoneNumbers" Resource.
*/
//var generate = require('./generate'),
// ListInstanceResource = require('./ListInstanceResource');
var IncomingPhoneNumbers_ = function (client, accountSid) {
var IncomingPhoneNumbers = ListInstanceResource_(client, accountSid, 'IncomingPhoneNumbers',
['GET', 'POST', 'PUT', 'DELETE', { update:'PUT' }],
['GET', 'POST', { create:'POST' }]
);
//Add local and toll-free subresources
IncomingPhoneNumbers.local = {};
generate_.restFunctions(IncomingPhoneNumbers.local, client, ['GET', 'POST'], IncomingPhoneNumbers.baseResourceUrl+'/Local');
IncomingPhoneNumbers.local.create = IncomingPhoneNumbers.local.post;
IncomingPhoneNumbers.tollFree = {};
generate_.restFunctions(IncomingPhoneNumbers.tollFree, client, ['GET', 'POST'], IncomingPhoneNumbers.baseResourceUrl+'/TollFree');
IncomingPhoneNumbers.tollFree.create = IncomingPhoneNumbers.tollFree.post;
return IncomingPhoneNumbers;
};