GroupService#
- class GroupService[source]#
Methods
Add a user (member) to a group.
Get a group by id.
Delete a group by id.
Remove a member from a group.
Update the name of the group.
- add_member(json_body, *, group_id, extra_parameters=None)[source]#
Add a user (member) to a group.
- Parameters:
json_body (
Union
[dict
,list
,UserInput
]) – The body of the request. SeeUserInput
for information about the possible fields. You can provide this data as aUserInput
or as a dictionary.group_id (
int
) – The id of the group the user should be added to.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GroupService[AuthenticatedClient]) –
- Returns:
The group with the newly added user.
- Return type:
- get(*, group_id, extra_parameters=None)[source]#
Get a group by id.
- Parameters:
- Returns:
The requested group.
- Return type:
- delete(*, group_id, extra_parameters=None)[source]#
Delete a group by id.
This action is irreversible!
This is only possible if the group doesn’t have any submissions associated with it.
- Parameters:
- Returns:
Nothing.
- Return type:
None
- remove_member(*, group_id, user_id, extra_parameters=None)[source]#
Remove a member from a group.
If the group has a submission you cannot delete the last remaining member of a group.
- Parameters:
group_id (
int
) – The group the user should be removed from.user_id (
int
) – The user that should be removed.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GroupService[AuthenticatedClient]) –
- Returns:
The group without the removed user.
- Return type:
- rename_group(json_body, *, group_id, extra_parameters=None)[source]#
Update the name of the group.
- Parameters:
json_body (
Union
[dict
,list
,RenameGroupGroupData
]) – The body of the request. SeeRenameGroupGroupData
for information about the possible fields. You can provide this data as aRenameGroupGroupData
or as a dictionary.group_id (
int
) – The id of the group that should be updated.extra_parameters (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
]]]) – The extra query parameters you might want to add. By default no extra query parameters are added.self (GroupService[AuthenticatedClient]) –
- Returns:
The group with the updated name.
- Return type: