}
@RequestMapping(value = "/{keyId}/edit", method = RequestMethod.POST)
public @ResponseBody RestResponse<APIKey> saveEdit(HttpServletRequest request,
@PathVariable("keyId") int keyId, @RequestParam(required = false) String note) {
APIKey apiKey = apiKeyService.loadAPIKey(keyId);
String isRestrictedKeyStr= request.getParameter("isRestrictedKey");
boolean restricted = (isRestrictedKeyStr != null && isRestrictedKeyStr.equalsIgnoreCase("true")) ? true : false ;
if (note != null) {
apiKey.setNote(note);
apiKey.setIsRestrictedKey(restricted);
apiKeyService.storeAPIKey(apiKey);
return RestResponse.success(apiKey);
} else {
log.warn(ResourceNotFoundException.getLogMessage("API Key", keyId));