@Override public void define(NewController context) { WebService.NewAction action = context.createAction(ACTION_DELETE) .setSince("6.6") .setDescription("Delete a non-main branch of a project.<br/>" + "Requires 'Administer' rights on the specified project.") .setPost(true) .setHandler(this); addProjectParam(action); addBranchParam(action); }
@Test public void define_ws() { BranchesWs underTest = new BranchesWs(new BranchWsAction() { @Override public void define(WebService.NewController context) { context.createAction("foo").setHandler(this); } @Override public void handle(Request request, Response response) { } }); WebService.Context context = new WebService.Context(); underTest.define(context); assertThat(context.controller("api/project_branches").action("foo")).isNotNull(); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_LIST) .setSince("6.6") .setDescription("List the branches of a project.<br/>" + "Requires 'Browse' or 'Execute analysis' rights on the specified project.") .setResponseExample(Resources.getResource(getClass(), "list-example.json")) .setChangelog(new Change("7.2", "Application can be used on this web service")) .setHandler(this); addProjectParam(action); }
@Override public void define(NewController context) { WebService.NewAction action = context.createAction(ACTION_RENAME) .setSince("6.6") .setDescription("Rename the main branch of a project.<br/>" + "Requires 'Administer' permission on the specified project.") .setPost(true) .setHandler(this); addProjectParam(action); action .createParam(PARAM_NAME) .setRequired(true) .setMaximumLength(255) .setDescription("New name of the main branch") .setExampleValue("branch1"); }
@Override public void define(NewController context) { WebService.NewAction action = context.createAction(ACTION_DELETE) .setSince("6.6") .setDescription("Delete a non-main branch of a project.<br/>" + "Requires 'Administer' rights on the specified project.") .setPost(true) .setHandler(this); addProjectParam(action); addBranchParam(action); }
@Override public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_LIST) .setSince("6.6") .setDescription("List the branches of a project.<br/>" + "Requires 'Browse' or 'Execute analysis' rights on the specified project.") .setResponseExample(Resources.getResource(getClass(), "list-example.json")) .setHandler(this); addProjectParam(action); }
@Override public void define(NewController context) { WebService.NewAction action = context.createAction(ACTION_RENAME) .setSince("6.6") .setDescription("Rename the main branch of a project.<br/>" + "Requires 'Administer' permission on the specified project.") .setPost(true) .setHandler(this); addProjectParam(action); action .createParam(PARAM_NAME) .setRequired(true) .setMaximumLength(255) .setDescription("New name of the main branch") .setExampleValue("branch1"); }