User Status

class nc_py_api.user_status._UserStatusAPI(session: NcSessionBasic)[source]

Class providing the user status management API on the Nextcloud server.

property available: bool

Returns True if the Nextcloud instance supports this feature, False otherwise.

get_list(limit: int | None = None, offset: int | None = None) list[UserStatus][source]

Returns statuses for all users.

get_current() CurrentUserStatus[source]

Returns the current user status.

get(user_id: str) UserStatus | None[source]

Returns the user status for the specified user.

get_predefined() list[PredefinedStatus][source]

Returns a list of predefined statuses available for installation on this Nextcloud instance.

set_predefined(status_id: str, clear_at: int = 0) None[source]

Set predefined status for the current user.

Parameters:
  • status_idpredefined status ID.

  • clear_atoptional time in seconds before the status is cleared.

set_status_type(value: Literal['online', 'away', 'dnd', 'invisible', 'offline']) None[source]

Sets the status type for the current user.

set_status(message: str | None = None, clear_at: int = 0, status_icon: str = '') None[source]

Sets current user status.

Parameters:
  • message – Message text to set in the status.

  • clear_at – Unix Timestamp, representing the time to clear the status.

  • status_icon – The icon picked by the user (must be one emoji)

get_backup_status(user_id: str = '') UserStatus | None[source]

Get the backup status of the user if any.

restore_backup_status(status_id: str) CurrentUserStatus | None[source]

Restores the backup state as current for the current user.

class nc_py_api.user_status.CurrentUserStatus(raw_data: dict)[source]

Information about current user status.

property status_id: str | None

ID of the predefined status.

property message_predefined: bool

True if the status is predefined, False otherwise.

property status_type_defined: bool

True if UserStatus.status_type is set by user, False otherwise.

class nc_py_api.user_status.UserStatus(raw_data: dict)[source]

Information about user status.

user_id: str

The ID of the user this status is for

property status_message: str

Message of the status.

property status_icon: str

The icon picked by the user (must be one emoji).

property status_clear_at: int | None

Unix Timestamp representing the time to clear the status.

property status_type: str

Status type, on of the: online, away, dnd, invisible, offline.

class nc_py_api.user_status.PredefinedStatus(raw_status: dict)[source]

Definition of the predefined status.

status_id: str

ID of the predefined status

icon: str

Icon in string(UTF) format

message: str

The message defined for this status. It is translated, so it depends on the user’s language setting.

clear_at: ClearAt | None

When the default, if not override, the predefined status will be cleared.

class nc_py_api.user_status.ClearAt(raw_data: dict)[source]

Determination when a user’s predefined status will be cleared.

clear_type: str

Possible values: period, end-of

time: str | int

Depending of type it can be number of seconds relative to now or one of the next values: day