class UserRolesController {

	@ApiOperation(httpMethod = "POST", value = "API to create roles details", response = Response.class,  consumes = MediaType.APPLICATION_JSON_VALUE)
	@RequestMapping(path = "/create", method = RequestMethod.POST,  consumes = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Object> createUserRole(@AuthenticationPrincipal Principal user,
			@ApiParam(value = "provide valid role details", required = true)
			@RequestBody(required = true) CreateRoleDetailsRequest roleDetailsRequest) {
		try {
			return ResponseUtils.buildSucessResponse(userRolesService.createUserRole(roleDetailsRequest, user.getName()));
		} catch (Exception exception) {
			log.error(UNEXPECTED_ERROR_OCCURRED, exception);
			return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage());
		}
	}

}