Class PostLabels
- java.lang.Object
-
- com.google.gerrit.server.restapi.project.PostLabels
-
- All Implemented Interfaces:
RestCollectionModifyView<ProjectResource,LabelResource,BatchLabelInput>
,RestCollectionView<ProjectResource,LabelResource,BatchLabelInput>
,RestView<LabelResource>
public class PostLabels extends Object implements RestCollectionModifyView<ProjectResource,LabelResource,BatchLabelInput>
REST endpoint that allows to add, update and delete label definitions in a batch.
-
-
Constructor Summary
Constructors Constructor Description PostLabels(com.google.inject.Provider<CurrentUser> user, PermissionBackend permissionBackend, MetaDataUpdate.User updateFactory, ProjectConfig.Factory projectConfigFactory, DeleteLabel deleteLabel, CreateLabel createLabel, SetLabel setLabel, ProjectCache projectCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response<?>
apply(ProjectResource rsrc, BatchLabelInput input)
Process the modification on the collection resource.
-
-
-
Constructor Detail
-
PostLabels
@Inject public PostLabels(com.google.inject.Provider<CurrentUser> user, PermissionBackend permissionBackend, MetaDataUpdate.User updateFactory, ProjectConfig.Factory projectConfigFactory, DeleteLabel deleteLabel, CreateLabel createLabel, SetLabel setLabel, ProjectCache projectCache)
-
-
Method Detail
-
apply
public Response<?> apply(ProjectResource rsrc, BatchLabelInput input) throws AuthException, UnprocessableEntityException, PermissionBackendException, IOException, org.eclipse.jgit.errors.ConfigInvalidException, BadRequestException, ResourceConflictException
Description copied from interface:RestCollectionModifyView
Process the modification on the collection resource.The value of the returned response is automatically converted to JSON unless it is a
BinaryResult
.The returned response defines the status code that is returned to the client. For RestCollectionModifyViews this is usually
200 OK
, but other 2XX or 3XX status codes are also possible (e.g.201 Created
if a resource was created,202 Accepted
if a background task was scheduled,204 No Content
if no content is returned,302 Found
for a redirect).Throwing a subclass of
RestApiException
results in a 4XX response to the client. For any other exception the client will get a500 Internal Server Error
response.- Specified by:
apply
in interfaceRestCollectionModifyView<ProjectResource,LabelResource,BatchLabelInput>
- Parameters:
rsrc
- the collection resource on which the modification is done- Returns:
- response to return to the client
- Throws:
AuthException
UnprocessableEntityException
PermissionBackendException
IOException
org.eclipse.jgit.errors.ConfigInvalidException
BadRequestException
ResourceConflictException
-
-