class OrganizationService extends Service {

  @GET
  @Produces(APPLICATION_JSON)
  @Path("/{parent}/organizations")
  @ApiOperation(
      value = "Get child organizations",
      response = OrganizationDto.class,
      responseContainer = "list")
  @ApiResponses({
    @ApiResponse(code = 200, message = "The child organizations successfully fetched"),
    @ApiResponse(code = 500, message = "Internal server error occurred")
  })
  public Response getByParent(
      @ApiParam("Parent organization id") @PathParam("parent") String parent,
      @ApiParam(value = "Max items") @QueryParam("maxItems") @DefaultValue("30") int maxItems,
      @ApiParam(value = "Skip count") @QueryParam("skipCount") @DefaultValue("0") int skipCount)
      throws ServerException, BadRequestException {

    checkArgument(maxItems >= 0, "The number of items to return can't be negative.");
    checkArgument(skipCount >= 0, "The number of items to skip can't be negative.");
    final Page<? extends Organization> organizationsPage =
        organizationManager.getByParent(parent, maxItems, skipCount);
    return Response.ok()
        .entity(
            organizationsPage.getItems(
                organization ->
                    linksInjector.injectLinks(asDto(organization), getServiceContext())))
        .header("Link", createLinkHeader(organizationsPage))
        .build();
  }

  @Inject public  OrganizationService(
      OrganizationManager organizationManager,
      OrganizationLinksInjector linksInjector,
      OrganizationValidator organizationValidator);

}