test powerpack

This commit is contained in:
huzaif-plivo 2021-08-11 17:35:15 +05:30
parent f6648e4b76
commit b2c76e00d7

View file

@ -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