snip.api.account¶
Account API wrapper.
This module provides functions to interact with the account endpoints of the Snip API.
As reference see also the [official API documentation](https://snip.roentgen.physik.uni-goettingen.de/apidocs/account).
Functions
|
Create a new group. |
|
Delete a specific group by its name. |
|
Retrieve a specific group by its ID. |
|
Retrieve all groups the user is a member of. |
|
Leave a specific group by its ID. |
|
Modify a specific group by its ID. |
Classes
Type definition for a group. |
|
Type definition for a group member. |
|
Type definition for updating member roles. |
Module Functions
- snip.api.account.create_group(token: AccountToken, name: str) Group¶
Create a new group.
- snip.api.account.delete_group(token: AccountToken, group_id: int) None¶
Delete a specific group by its name.
- snip.api.account.get_group(token: AccountToken, group_id: int) Group¶
Retrieve a specific group by its ID.
- snip.api.account.get_groups(token: AccountToken) list[Group]¶
Retrieve all groups the user is a member of.
- snip.api.account.leave_group(token: AccountToken, group_id: int) None¶
Leave a specific group by its ID.
- snip.api.account.modify_group(token: AccountToken, group_id: int, name: str | None = None, description: str | None = None, update_member_roles: list[MemberRoleUpdate] | None = None, remove_members: list[int] | None = None, transfer_ownership: int | None = None) Group¶
Modify a specific group by its ID.
- Parameters:
token – Authentication token
group_id – ID of the group to modify
name – New group name (3-255 characters)
description – New group description
update_member_roles – List of user_id and role updates
remove_members – List of user IDs to remove from group
transfer_ownership – User ID to transfer group ownership to