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:RestCollectionModifyViewProcess 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 Createdif a resource was created,202 Acceptedif a background task was scheduled,204 No Contentif no content is returned,302 Foundfor a redirect).Throwing a subclass of
RestApiExceptionresults in a 4XX response to the client. For any other exception the client will get a500 Internal Server Errorresponse.- Specified by:
applyin interfaceRestCollectionModifyView<ProjectResource,LabelResource,BatchLabelInput>- Parameters:
rsrc- the collection resource on which the modification is done- Returns:
- response to return to the client
- Throws:
AuthExceptionUnprocessableEntityExceptionPermissionBackendExceptionIOExceptionorg.eclipse.jgit.errors.ConfigInvalidExceptionBadRequestExceptionResourceConflictException
-
-