You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.2 KiB
29 lines
1.2 KiB
3 years ago
|
/**
|
||
|
@module resources/AvailablePhoneNumbers
|
||
|
The Twilio "AvailablePhoneNumbers" Resource.
|
||
|
*/
|
||
|
var generate = require('./generate'),
|
||
|
ListInstanceResource = require('./ListInstanceResource');
|
||
|
|
||
|
module.exports = 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;
|
||
|
|
||
|
IncomingPhoneNumbers.mobile = {};
|
||
|
generate.restFunctions(IncomingPhoneNumbers.mobile, client, ['GET', 'POST'], IncomingPhoneNumbers.baseResourceUrl+'/Mobile');
|
||
|
IncomingPhoneNumbers.mobile.create = IncomingPhoneNumbers.mobile.post;
|
||
|
|
||
|
return IncomingPhoneNumbers;
|
||
|
};
|