use of jetbrains.buildServer.users.SimplePropertyKey in project teamcity-rest by JetBrains.
the class UserRequest method putUserProperty.
@PUT
@Path("/{userLocator}/properties/{name}")
@Consumes("text/plain")
@Produces("text/plain")
@ApiOperation(value = "Update a property of the matching user.", nickname = "setUserProperty")
public String putUserProperty(@ApiParam(format = LocatorName.USER) @PathParam("userLocator") String userLocator, @PathParam("name") String name, String newValue) {
SUser user = myUserFinder.getItem(userLocator, true);
if (StringUtil.isEmpty(name)) {
throw new BadRequestException("Property name cannot be empty.");
}
user.setUserProperty(new SimplePropertyKey(name), newValue);
return BuildTypeUtil.getParameter(name, User.getProperties(myUserFinder.getItem(userLocator, true)), false, true, myBeanContext.getServiceLocator());
}
use of jetbrains.buildServer.users.SimplePropertyKey in project teamcity-rest by JetBrains.
the class GroupRequest method removeUserProperty.
@DELETE
@Path("/{groupLocator}/properties/{name}")
@ApiOperation(value = "Remove a property of the matching user group.", nickname = "removeGroupProperty")
public void removeUserProperty(@PathParam("groupLocator") String groupLocator, @PathParam("name") String name) {
SUserGroup group = myUserGroupFinder.getGroup(groupLocator);
if (StringUtil.isEmpty(name)) {
throw new BadRequestException("Property name cannot be empty.");
}
group.deleteGroupProperty(new SimplePropertyKey(name));
}
use of jetbrains.buildServer.users.SimplePropertyKey in project teamcity-rest by JetBrains.
the class UserRequest method removeUserProperty.
@DELETE
@Path("/{userLocator}/properties/{name}")
@ApiOperation(value = "Remove a property of the matching user.", nickname = "removeUserProperty")
public void removeUserProperty(@ApiParam(format = LocatorName.USER) @PathParam("userLocator") String userLocator, @PathParam("name") String name) {
SUser user = myUserFinder.getItem(userLocator, true);
if (StringUtil.isEmpty(name)) {
throw new BadRequestException("Property name cannot be empty.");
}
user.deleteUserProperty(new SimplePropertyKey(name));
}
Aggregations