class RoutingRulesResource extends ComponentSupport implements Resource {

  @GET
  public List<RoutingRuleXO> getRoutingRules(@QueryParam("includeRepositoryNames") boolean includeRepositoryNames) {
    routingRuleHelper.ensureUserHasPermissionToRead();

    List<RoutingRuleXO> rules = routingRuleStore.list()
            .stream()
            .map(RoutingRulesResource::toXO)
        .collect(toList());

    if (includeRepositoryNames) {
      setAssignedRepositories(rules);
    }

    return rules;
  }

  @Inject public  RoutingRulesResource(final RoutingRuleStore routingRuleStore,
                              final RoutingRuleHelper routingRuleHelper,
                              final RepositoryPermissionChecker repositoryPermissionChecker);

}