use of jetbrains.buildServer.server.rest.data.change.CommiterData in project teamcity-rest by JetBrains.
the class ChangeRequest method getUniqueCommiters.
/**
* Experimental support only!
* @since 2021.1.1
*/
@GET
@Path("/{changeLocator}/commiters")
@Produces({ "application/xml", "application/json" })
@ApiOperation(value = "Get unique commiters of the matching changes.", nickname = "getUniqueCommiters", hidden = true)
public Commiters getUniqueCommiters(@ApiParam(format = LocatorName.CHANGE) @PathParam("changeLocator") String changeLocator, @QueryParam("fields") String fields) {
Locator patchedChangeLocator = Locator.createPotentiallyEmptyLocator(changeLocator);
if (!patchedChangeLocator.isAnyPresent(PagerData.COUNT)) {
String lookupLimit = TeamCityProperties.getProperty("rest.request.changes.committersLookupLimit", DEFAULT_CHANGES_LOOKUP_LIMIT_FOR_COMMITERS);
patchedChangeLocator.setDimension(PagerData.COUNT, lookupLimit);
}
PagedSearchResult<SVcsModificationOrChangeDescriptor> changes = myChangeFinder.getItems(patchedChangeLocator.getStringRepresentation());
List<CommiterData> commiters = ChangeUtil.getUniqueCommiters(changes.myEntries.stream().map(modOrDesc -> modOrDesc.getSVcsModification()));
return new Commiters(commiters, new Fields(fields), myBeanContext);
}
Aggregations