class RuleController {

	@ApiOperation(httpMethod = "POST", value = "API to update new rule", response = Response.class, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	@RequestMapping(path = "/update", method = RequestMethod.POST, consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	public ResponseEntity<Object> updateRule(@AuthenticationPrincipal Principal user,
			@ApiParam(value = "provide valid rule details", required = false) @RequestParam(value = "file", required = false) MultipartFile fileToUpload, CreateUpdateRuleDetails updateRuleDetails) {
		try {
			return ResponseUtils.buildSucessResponse(ruleService.updateRule(fileToUpload, updateRuleDetails, user.getName()));
		} catch (Exception exception) {
			log.error(UNEXPECTED_ERROR_OCCURRED, exception);
			return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage());
		}
	}

}