public class GroupsCollection extends Object implements RestCollection<TopLevelResource,GroupResource>, AcceptsCreate<TopLevelResource>, NeedsParams
| Modifier and Type | Method and Description |
|---|---|
CreateGroup |
create(TopLevelResource root,
IdString name)
Handle creation of a child resource.
|
RestView<TopLevelResource> |
list()
Create a view to list the contents of the collection.
|
GroupDescription.Basic |
parse(String id)
Parses a group ID from a request body and returns the group.
|
GroupResource |
parse(TopLevelResource parent,
IdString id)
Parse a path component into a resource handle.
|
GroupDescription.Basic |
parseId(String id)
Parses a group ID and returns the group without making any permission check whether the current
user can see the group.
|
GroupDescription.Basic |
parseInternal(String id)
Parses a group ID from a request body and returns the group if it is a Gerrit internal group.
|
void |
setParams(com.google.common.collect.ListMultimap<String,String> params)
Sets the request parameter.
|
DynamicMap<RestView<GroupResource>> |
views()
Get the views that support this collection.
|
public void setParams(com.google.common.collect.ListMultimap<String,String> params) throws BadRequestException
NeedsParamssetParams in interface NeedsParamsparams - the request parameterBadRequestExceptionpublic RestView<TopLevelResource> list() throws ResourceNotFoundException, AuthException
RestCollectionThe returned view should accept the parent type to scope the search, and may want to take a "q" parameter option to narrow the results.
list in interface RestCollection<TopLevelResource,GroupResource>ResourceNotFoundException - if the collection cannot be listed.AuthException - if the collection requires authentication.public GroupResource parse(TopLevelResource parent, IdString id) throws AuthException, ResourceNotFoundException
RestCollectionparse in interface RestCollection<TopLevelResource,GroupResource>parent - the handle to the collection.id - string identifier supplied by the client. In a URL such as /changes/1234/abandon this string is "1234".ResourceNotFoundException - the object does not exist, or the caller is not permitted to
know if the resource exists.AuthExceptionpublic GroupDescription.Basic parse(String id) throws UnprocessableEntityException
id - ID of the group, can be a group UUID, a group name or a legacy group IDUnprocessableEntityException - thrown if the group ID cannot be resolved or if the group
is not visible to the calling userpublic GroupDescription.Basic parseInternal(String id) throws UnprocessableEntityException
id - ID of the group, can be a group UUID, a group name or a legacy group IDUnprocessableEntityException - thrown if the group ID cannot be resolved, if the group is
not visible to the calling user or if it's an external grouppublic GroupDescription.Basic parseId(String id)
id - ID of the group, can be a group UUID, a group name or a legacy group IDpublic CreateGroup create(TopLevelResource root, IdString name)
AcceptsCreatecreate in interface AcceptsCreate<TopLevelResource>root - parent collection handle.name - id of the resource being created.public DynamicMap<RestView<GroupResource>> views()
RestCollectionWithin a resource the views are accessed as RESOURCE/plugin~view.
views in interface RestCollection<TopLevelResource,GroupResource>