writeResponse(response, update.getRuleKey());
}
private RuleUpdate readRequest(Request request) {
RuleKey key = RuleKey.parse(request.mandatoryParam(PARAM_KEY));
RuleUpdate update = createRuleUpdate(key);
readTags(request, update);
readMarkdownNote(request, update);
readDebt(request, update);
String name = request.param(PARAM_NAME);
if (name != null) {
update.setName(name);
}
String description = request.param(PARAM_DESCRIPTION);
if (description != null) {
update.setMarkdownDescription(description);
}
String severity = request.param(PARAM_SEVERITY);
if (severity != null) {
update.setSeverity(severity);
}
String status = request.param(PARAM_STATUS);
if (status != null) {
update.setStatus(RuleStatus.valueOf(status));
}
String params = request.param(PARAMS);
if (params != null) {
update.setParameters(KeyValueFormat.parse(params));
}
return update;
}