mirror of
https://github.com/donl/plivo-node.git
synced 2026-06-04 22:07:01 -06:00
test powerpack
This commit is contained in:
parent
f6648e4b76
commit
b2c76e00d7
1 changed files with 2 additions and 41 deletions
|
|
@ -40,22 +40,6 @@ export class CreatePowerpackResponse {
|
|||
}
|
||||
}
|
||||
|
||||
export class RetrievePowerpack {
|
||||
constructor(params) {
|
||||
params = params || {};
|
||||
this.apiId = params.apiId;
|
||||
this.applicationId = params.applicationId;
|
||||
this.applicationType = params.applicationType;
|
||||
this.createdOn = params.createdOn;
|
||||
this.localConnect = params.localConnect;
|
||||
this.name = params.name;
|
||||
this.numberPool = params.numberPool;
|
||||
this.numberPriority = params.numberPriority;
|
||||
this.stickySender = params.stickySender;
|
||||
this.uuid = params.uuid;
|
||||
}
|
||||
}
|
||||
|
||||
export class UpdatePowerpackResponse {
|
||||
constructor(params) {
|
||||
params = params || {};
|
||||
|
|
@ -711,32 +695,9 @@ export class PowerpackInterface extends PlivoResourceInterface {
|
|||
* @promise {object} return {@link Powerpack} object
|
||||
* @fail {Error} return Error
|
||||
*/
|
||||
get(uuid) {
|
||||
let errors = validate([{
|
||||
field: 'uuid',
|
||||
value: uuid,
|
||||
validators: ['isRequired']
|
||||
}]);
|
||||
|
||||
if (errors) {
|
||||
return errors;
|
||||
}
|
||||
|
||||
let client = this[clientKey];
|
||||
return new Promise((resolve, reject) => {
|
||||
if (action !== '' && !uuid) {
|
||||
reject(new Error(this[idKey] + ' must be set'));
|
||||
}
|
||||
client('GET', action + (uuid ? uuid + '/' : ''))
|
||||
.then(response => {
|
||||
resolve(new PlivoGenericResponse(response.body, client));
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
get(uuid) {
|
||||
return super.get(uuid);
|
||||
}
|
||||
|
||||
/**
|
||||
* create Powerpack
|
||||
* @method
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue