GroupService

class GroupService[source]

Methods

add_member

Add a user (member) to a group.

get

Get a group by id.

delete

Delete a group by id.

remove_member

Remove a member from a group.

rename_group

Update the name of the group.

add_member(json_body, *, group_id)[source]

Add a user (member) to a group.

Parameters:
  • json_body (TypeAliasType) – The body of the request. See UserInput for information about the possible fields. You can provide this data as a UserInput or as a dictionary.

  • group_id (int) – The id of the group the user should be added to.

  • self (GroupService[AuthenticatedClient])

Returns:

The group with the newly added user.

Return type:

ExtendedGroup

get(*, group_id)[source]

Get a group by id.

Parameters:
Returns:

The requested group.

Return type:

ExtendedGroup

delete(*, group_id)[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)[source]

Remove a member from a group.

If the group has a submission you cannot delete the last remaining member of a group.

Parameters:
Returns:

The group without the removed user.

Return type:

ExtendedGroup

rename_group(json_body, *, group_id)[source]

Update the name of the group.

Parameters:
Returns:

The group with the updated name.

Return type:

ExtendedGroup