Class PostLabels
java.lang.Object
com.google.gerrit.server.restapi.project.AbstractPostCollection<String,LabelResource,LabelDefinitionInput,BatchLabelInput>
com.google.gerrit.server.restapi.project.PostLabels
- All Implemented Interfaces:
RestCollectionModifyView<ProjectResource,,LabelResource, BatchLabelInput> RestCollectionView<ProjectResource,,LabelResource, BatchLabelInput> RestView<LabelResource>
public class PostLabels
extends AbstractPostCollection<String,LabelResource,LabelDefinitionInput,BatchLabelInput>
REST endpoint that allows to add, update and delete label definitions in a batch.
-
Constructor Summary
ConstructorsConstructorDescriptionPostLabels(com.google.inject.Provider<CurrentUser> user, DeleteLabel deleteLabel, CreateLabel createLabel, SetLabel setLabel, RepoMetaDataUpdater updater) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateItem(ProjectConfig config, LabelDefinitionInput labelInput) Provides default commit message when user doesn't specify one in the input.protected voiddeleteItem(ProjectConfig config, String name) protected booleanupdateItem(ProjectConfig config, String name, LabelDefinitionInput resource) Methods inherited from class com.google.gerrit.server.restapi.project.AbstractPostCollection
apply, updateProjectConfig
-
Constructor Details
-
PostLabels
@Inject public PostLabels(com.google.inject.Provider<CurrentUser> user, DeleteLabel deleteLabel, CreateLabel createLabel, SetLabel setLabel, RepoMetaDataUpdater updater)
-
-
Method Details
-
defaultCommitMessage
Description copied from class:AbstractPostCollectionProvides default commit message when user doesn't specify one in the input.- Specified by:
defaultCommitMessagein classAbstractPostCollection<String,LabelResource, LabelDefinitionInput, BatchLabelInput>
-
updateItem
protected boolean updateItem(ProjectConfig config, String name, LabelDefinitionInput resource) throws BadRequestException, ResourceConflictException, UnprocessableEntityException - Specified by:
updateItemin classAbstractPostCollection<String,LabelResource, LabelDefinitionInput, BatchLabelInput> - Throws:
BadRequestExceptionResourceConflictExceptionUnprocessableEntityException
-
createItem
protected void createItem(ProjectConfig config, LabelDefinitionInput labelInput) throws BadRequestException, ResourceConflictException - Specified by:
createItemin classAbstractPostCollection<String,LabelResource, LabelDefinitionInput, BatchLabelInput> - Throws:
BadRequestExceptionResourceConflictException
-
deleteItem
- Specified by:
deleteItemin classAbstractPostCollection<String,LabelResource, LabelDefinitionInput, BatchLabelInput> - Throws:
UnprocessableEntityException
-