class MergeRequestRest {

    @POST
    @Path("{requestId}")
    @RolesAllowed("user")
    @ApiOperation("Accepts a MergeRequest by performing the merge and changing the type")
    @ActionId(Modify.TYPE)
    @ResourceId(type = ValueType.PROP_PATH, value = "<" + MergeRequest.onRecord_IRI + ">",
            start = @Value(type = ValueType.PATH, value = "requestId"))
    @ActionAttributes(@AttributeValue(type = ValueType.PROP_PATH, value = "<" + MergeRequest.targetBranch_IRI + ">",
            id = VersionedRDFRecord.branch_IRI, start = @Value(type = ValueType.PATH, value = "requestId")))
    public Response acceptMergeRequest(@Context ContainerRequestContext context,
                                @PathParam("requestId") String requestId) {
        Resource requestIdResource = createIRI(requestId, vf);
        User activeUser = getActiveUser(context, engineManager);
        try {
            manager.acceptMergeRequest(requestIdResource, activeUser);
            return Response.ok().build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.BAD_REQUEST);
        } catch (IllegalStateException | MobiException ex) {
            throw ErrorUtils.sendError(ex, ex.getMessage(), Response.Status.INTERNAL_SERVER_ERROR);
        }
    }

}