public class GroupsCollection extends java.lang.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(java.lang.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(java.lang.String id)
Parses a group ID and returns the group without making any permission check whether the current
user can see the group.
|
GroupDescription.Internal |
parseInternal(java.lang.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<java.lang.String,java.lang.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<java.lang.String,java.lang.String> params) throws BadRequestException
NeedsParams
setParams
in interface NeedsParams
params
- the request parameterBadRequestException
public RestView<TopLevelResource> list() throws ResourceNotFoundException, AuthException
RestCollection
The 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
RestCollection
parse
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.AuthException
public GroupDescription.Basic parse(java.lang.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.Internal parseInternal(java.lang.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(java.lang.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)
AcceptsCreate
create
in interface AcceptsCreate<TopLevelResource>
root
- parent collection handle.name
- id of the resource being created.public DynamicMap<RestView<GroupResource>> views()
RestCollection
Within a resource the views are accessed as RESOURCE/plugin~view
.
views
in interface RestCollection<TopLevelResource,GroupResource>