-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
208 additions
and
1 deletion.
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,15 @@ | ||
'use strict'; | ||
|
||
var TelnyxResource = require('../TelnyxResource'); | ||
var telnyxMethod = TelnyxResource.method; | ||
|
||
module.exports = TelnyxResource.extend({ | ||
path: 'number_order_documents', | ||
includeBasic: ['list', 'retrieve', 'update'], | ||
|
||
upload: telnyxMethod({ | ||
method: 'POST', | ||
methodType: 'create', | ||
}), | ||
}); | ||
|
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,9 @@ | ||
'use strict'; | ||
|
||
var TelnyxResource = require('../TelnyxResource'); | ||
|
||
module.exports = TelnyxResource.extend({ | ||
path: 'phone_number_regulatory_requirements', | ||
|
||
includeBasic: ['list'], | ||
}); |
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,9 @@ | ||
'use strict'; | ||
|
||
var TelnyxResource = require('../TelnyxResource'); | ||
|
||
module.exports = TelnyxResource.extend({ | ||
path: 'regulatory_requirements', | ||
|
||
includeBasic: ['list', 'retrieve'], | ||
}); |
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,97 @@ | ||
'use strict'; | ||
|
||
var telnyx = require('../../testUtils').getTelnyxMock(); | ||
var expect = require('chai').expect; | ||
|
||
var TEST_AUTH_KEY = 'KEY187557EC22404DB39975C43ACE661A58_9QdDI7XD5bvyahtaWx1YQo'; | ||
|
||
describe('NumberOrderDocuments Resource', function() { | ||
describe('retrieve', function() { | ||
function responseFn(response) { | ||
expect(response.data).to.include({ | ||
id: '387d1e31-a218-4375-8151-103f2d5e2d2c', | ||
record_type: 'number_order_document' | ||
}); | ||
expect(response.data).to.have.property('file_id'); | ||
expect(response.data).to.have.property('requirements_id'); | ||
expect(response.data).to.have.property('requirement_type'); | ||
} | ||
|
||
it('Sends the correct request', function() { | ||
return telnyx.numberOrderDocuments.retrieve('387d1e31-a218-4375-8151-103f2d5e2d2c') | ||
.then(responseFn); | ||
}); | ||
|
||
it('Sends the correct request [with specified auth]', function() { | ||
return telnyx.numberOrderDocuments.retrieve( | ||
'387d1e31-a218-4375-8151-103f2d5e2d2c', TEST_AUTH_KEY | ||
) | ||
.then(responseFn); | ||
}); | ||
}); | ||
|
||
describe('list', function() { | ||
function responseFn(response) { | ||
expect(response.data[0]).to.have.property('id'); | ||
expect(response.data[0]).to.have.property('file_id'); | ||
expect(response.data[0]).to.have.property('requirements_id'); | ||
expect(response.data[0]).to.have.property('requirement_type'); | ||
expect(response.data[0]).to.include({record_type: 'number_order_document'}); | ||
} | ||
|
||
it('Sends the correct request', function() { | ||
return telnyx.numberOrderDocuments.list() | ||
.then(responseFn); | ||
}); | ||
|
||
it('Sends the correct request [with specified auth]', function() { | ||
return telnyx.numberOrderDocuments.list(TEST_AUTH_KEY) | ||
.then(responseFn); | ||
}); | ||
}); | ||
|
||
describe('update', function() { | ||
it('Sends the correct request', function() { | ||
return telnyx.numberOrderDocuments.update( | ||
'387d1e31-a218-4375-8151-103f2d5e2d2c', | ||
{file_id: '1e3c5822-0362-4702-8e46-5a129f0d3976'} | ||
) | ||
.then(function(response) { | ||
expect(response.data).to.include({ | ||
record_type: 'number_order_document', | ||
}); | ||
expect(response.data).to.have.property('file_id'); | ||
expect(response.data).to.have.property('requirements_id'); | ||
expect(response.data).to.have.property('requirement_type'); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('upload', function() { | ||
function responseFn(response) { | ||
expect(response.data).to.include({ | ||
record_type: 'number_order_document', | ||
}); | ||
expect(response.data).to.have.property('file_id'); | ||
expect(response.data).to.have.property('requirements_id'); | ||
expect(response.data).to.have.property('requirement_type'); | ||
} | ||
|
||
it('Sends the correct request', function() { | ||
return telnyx.numberOrderDocuments.upload({ | ||
requirements_id: '36aaf27d-986b-493c-bd1b-de16af2e4292' | ||
}) | ||
.then(responseFn); | ||
}); | ||
|
||
it('Sends the correct request [with specified auth]', function() { | ||
return telnyx.numberOrderDocuments.upload( | ||
{ | ||
requirements_id: '36aaf27d-986b-493c-bd1b-de16af2e4292' | ||
}, | ||
TEST_AUTH_KEY | ||
) | ||
.then(responseFn); | ||
}); | ||
}); | ||
}); |
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,30 @@ | ||
'use strict'; | ||
|
||
var telnyx = require('../../testUtils').getTelnyxMock(); | ||
var expect = require('chai').expect; | ||
|
||
var TEST_AUTH_KEY = 'KEY187557EC22404DB39975C43ACE661A58_9QdDI7XD5bvyahtaWx1YQo'; | ||
|
||
describe('PhoneNumberRegulatoryRequirements Resource', function() { | ||
describe('list', function() { | ||
function responseFn(response) { | ||
expect(response.data[0]).to.have.property('phone_number'); | ||
expect(response.data[0]).to.have.property('regulatory_group_id'); | ||
expect(response.data[0]).to.have.property('regulatory_requirements'); | ||
expect(response.data[0]).to.include({record_type: 'phone_number_regulatory_group'}); | ||
expect(response.data[0].regulatory_requirements[0]).to.have.property('requirement_type'); | ||
expect(response.data[0].regulatory_requirements[0]).to.have.property('label'); | ||
expect(response.data[0].regulatory_requirements[0]).to.have.property('field_type'); | ||
} | ||
|
||
it('Sends the correct request', function() { | ||
return telnyx.phoneNumberRegulatoryRequirements.list() | ||
.then(responseFn); | ||
}); | ||
|
||
it('Sends the correct request [with specified auth]', function() { | ||
return telnyx.phoneNumberRegulatoryRequirements.list(TEST_AUTH_KEY) | ||
.then(responseFn); | ||
}); | ||
}); | ||
}); |
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,44 @@ | ||
'use strict'; | ||
|
||
var telnyx = require('../../testUtils').getTelnyxMock(); | ||
var expect = require('chai').expect; | ||
|
||
var TEST_AUTH_KEY = 'KEY187557EC22404DB39975C43ACE661A58_9QdDI7XD5bvyahtaWx1YQo'; | ||
|
||
describe('RegulatoryRequirements Resource', function() { | ||
describe('retrieve', function() { | ||
function responseFn(response) { | ||
expect(response.data).to.have.property('requirement_type'); | ||
expect(response.data).to.have.property('label'); | ||
expect(response.data).to.have.property('description'); | ||
} | ||
|
||
it('Sends the correct request', function() { | ||
return telnyx.regulatoryRequirements.retrieve('123') | ||
.then(responseFn); | ||
}); | ||
|
||
it('Sends the correct request [with specified auth]', function() { | ||
return telnyx.regulatoryRequirements.retrieve('123', TEST_AUTH_KEY) | ||
.then(responseFn); | ||
}); | ||
}); | ||
|
||
describe('list', function() { | ||
function responseFn(response) { | ||
expect(response.data[0]).to.have.property('requirement_type'); | ||
expect(response.data[0]).to.have.property('label'); | ||
expect(response.data[0]).to.have.property('description'); | ||
} | ||
|
||
it('Sends the correct request', function() { | ||
return telnyx.regulatoryRequirements.list() | ||
.then(responseFn); | ||
}); | ||
|
||
it('Sends the correct request [with specified auth]', function() { | ||
return telnyx.regulatoryRequirements.list(TEST_AUTH_KEY) | ||
.then(responseFn); | ||
}); | ||
}); | ||
}); |