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 void
createItem
(ProjectConfig config, LabelDefinitionInput labelInput) Provides default commit message when user doesn't specify one in the input.protected void
deleteItem
(ProjectConfig config, String name) protected boolean
updateItem
(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:AbstractPostCollection
Provides default commit message when user doesn't specify one in the input.- Specified by:
defaultCommitMessage
in classAbstractPostCollection<String,
LabelResource, LabelDefinitionInput, BatchLabelInput>
-
updateItem
protected boolean updateItem(ProjectConfig config, String name, LabelDefinitionInput resource) throws BadRequestException, ResourceConflictException, UnprocessableEntityException - Specified by:
updateItem
in classAbstractPostCollection<String,
LabelResource, LabelDefinitionInput, BatchLabelInput> - Throws:
BadRequestException
ResourceConflictException
UnprocessableEntityException
-
createItem
protected void createItem(ProjectConfig config, LabelDefinitionInput labelInput) throws BadRequestException, ResourceConflictException - Specified by:
createItem
in classAbstractPostCollection<String,
LabelResource, LabelDefinitionInput, BatchLabelInput> - Throws:
BadRequestException
ResourceConflictException
-
deleteItem
- Specified by:
deleteItem
in classAbstractPostCollection<String,
LabelResource, LabelDefinitionInput, BatchLabelInput> - Throws:
UnprocessableEntityException
-