User
- class asyncpow.apis.user.User(base_url: URL, api_key: str, session: ClientSession, raw_response: bool)[source]
Initialize the User object with the base URL and API key.
- async async_get_user(take: int = 20, skip: int = 0, sort: Literal['created'] = 'created', id: int = None, raw_response: bool | None = None) dict | UserModel | list[UserModel] [source]
Get a user record, or all user records
- Parameters:
take (int) – limit number of records
skip (int) – skip number of records
sort (_type_) – sort records
id (int, optional) – User ID if it is known. Defaults to None.
raw_response (bool, optional) – return raw json. Defaults to None.
- Returns:
Returns json dictionary or UserModel
- Return type:
dict | UserModel
- async async_create_user(email: str, username: str, permissions: int, raw_response: bool | None = None) dict | UserModel [source]
Create a new user
- Parameters:
email (str) – user email address
username (str) – username
permissions (int) – ID for the required permission
raw_response (bool, optional) – return raw json. Defaults to None.
- Returns:
Returns json dictionary or UserModel
- Return type:
dict | UserModel
- async async_bulk_update_user(ids: list[int], permissions: int, raw_response: bool | None = None) dict | list[UserModel] [source]
Update a list of users
- Parameters:
ids (list[int]) – List of user IDs to update
permissions (int) – Permission ID to change to
raw_response (bool, optional) – return raw json. Defaults to None.
- Returns:
Returns json dictionary or list of UserModel
- Return type:
dict | list[UserModel]