775ac7b58c
you must login with an BTP account in order to see the app
36 lines
1 KiB
JavaScript
36 lines
1 KiB
JavaScript
'use strict';
|
|
|
|
var utils = require('../utils');
|
|
var common = require('./common');
|
|
var ConfigurationChangeBase = require('../base-messages/ConfigurationChangeBase');
|
|
|
|
module.exports = ConfigurationChangeMessage;
|
|
|
|
function ConfigurationChangeMessage(content, transport) {
|
|
ConfigurationChangeBase.call(this, content, transport);
|
|
}
|
|
|
|
require('util').inherits(ConfigurationChangeMessage, ConfigurationChangeBase);
|
|
|
|
ConfigurationChangeMessage.prototype.successful = function (success) {
|
|
utils.validate.boolean(success, 'successful');
|
|
this._content.success = success;
|
|
return this;
|
|
};
|
|
|
|
ConfigurationChangeMessage.prototype.attribute = function (name, oldValue, newValue) {
|
|
utils.validate.notEmptyString(name, 'attribute name');
|
|
utils.validate.string(oldValue, 'old value');
|
|
utils.validate.string(newValue, 'new value');
|
|
utils.validate.attributeName(this._content.attributes, name);
|
|
|
|
this._content.attributes.push({
|
|
name: name,
|
|
old: oldValue,
|
|
new: newValue
|
|
});
|
|
|
|
return this;
|
|
};
|
|
|
|
ConfigurationChangeMessage.prototype.log = common.log;
|