SAP-BTP-Spielwiese/app1/node_modules/@sap/audit-logging/lib/v1/ConfigurationChangeMessage.js

37 lines
1 KiB
JavaScript
Raw Permalink Normal View History

'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;