-
Notifications
You must be signed in to change notification settings - Fork 516
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from twilio/sip-in
LGTM - ran some basic local tests and the endpoints look good. Will include test specs int he rewrite of the suite I am working on (to run offline).
- Loading branch information
Showing
4 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
@module resources/sip/CredentialLists | ||
The Twilio "CredentialLists" Resource. | ||
*/ | ||
var generate = require('../generate'), | ||
ListInstanceResource = require('../ListInstanceResource'); | ||
|
||
module.exports = function (client, accountSid) { | ||
var baseResourceUrl = '/Accounts/' + accountSid + '/SIP/CredentialLists'; | ||
|
||
//Instance requests | ||
function CredentialLists(sid) { | ||
var resourceApi = {} | ||
|
||
generate.restFunctions(resourceApi, client, | ||
['GET', 'POST', 'DELETE', {update: 'POST'}], | ||
baseResourceUrl + '/' + sid | ||
); | ||
|
||
resourceApi.credentials = ListInstanceResource(client, accountSid, | ||
'SIP/CredentialLists/' + sid + '/Credentials', | ||
['GET', 'POST', 'DELETE', {update: 'POST'}], | ||
['GET', 'POST', {list: 'GET'}, {create: 'POST'}] | ||
); | ||
|
||
return resourceApi; | ||
} | ||
|
||
generate.restFunctions(CredentialLists, client, | ||
['GET', 'POST', {create: 'POST'}, {list: 'GET'}], | ||
baseResourceUrl | ||
); | ||
|
||
return CredentialLists; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
@module resources/sip/Domains | ||
The Twilio "Domains" Resource. | ||
*/ | ||
var generate = require('../generate'), | ||
ListInstanceResource = require('../ListInstanceResource'); | ||
|
||
module.exports = function (client, accountSid) { | ||
var baseResourceUrl = '/Accounts/' + accountSid + '/SIP/Domains'; | ||
|
||
//Instance requests | ||
function Domains(sid) { | ||
var resourceApi = {} | ||
|
||
generate.restFunctions(resourceApi, client, | ||
['GET', 'POST', 'DELETE', {update: 'POST'}], | ||
baseResourceUrl + '/' + sid | ||
); | ||
|
||
resourceApi.ipAccessControlListMappings = ListInstanceResource(client, accountSid, | ||
'SIP/Domains/' + sid + '/IpAccessControlListMappings', | ||
['GET', 'DELETE'], | ||
['GET', 'POST', {create:'POST'}, {list: 'GET'}] | ||
); | ||
|
||
resourceApi.credentialListMappings = ListInstanceResource(client, accountSid, | ||
'SIP/Domains/' + sid + '/CredentialListMappings', | ||
['GET', 'DELETE'], | ||
['GET', 'POST', {create:'POST'}, {list: 'GET'}] | ||
); | ||
|
||
return resourceApi; | ||
}; | ||
|
||
generate.restFunctions(Domains, client, | ||
['GET', 'POST', {create: 'POST'}, {list: 'GET'}], | ||
baseResourceUrl | ||
); | ||
|
||
return Domains; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** | ||
@module resources/sip/IpAccessControlLists | ||
The Twilio "IpAccessControlLists" Resource. | ||
*/ | ||
var generate = require('../generate'), | ||
ListInstanceResource = require('../ListInstanceResource'); | ||
|
||
module.exports = function (client, accountSid) { | ||
var baseResourceUrl = '/Accounts/' + accountSid + '/SIP/IpAccessControlLists'; | ||
|
||
//Instance requests | ||
function IpAccessControlLists(sid) { | ||
var resourceApi = {} | ||
|
||
generate.restFunctions(resourceApi, client, | ||
['GET', 'POST', 'DELETE', {update: 'POST'}], | ||
baseResourceUrl + '/' + sid | ||
); | ||
|
||
resourceApi.ipAddresses = ListInstanceResource(client, accountSid, | ||
'SIP/IpAccessControlLists/' + sid + '/IpAddresses', | ||
['GET', 'POST', 'DELETE', {update: 'POST'}], | ||
['GET', 'POST', {list: 'GET'}, {create: 'POST'}] | ||
); | ||
|
||
return resourceApi; | ||
} | ||
|
||
generate.restFunctions(IpAccessControlLists, client, | ||
['GET', 'POST', {create: 'POST'}, {list: 'GET'}], | ||
baseResourceUrl | ||
); | ||
|
||
|
||
return IpAccessControlLists; | ||
|
||
} |