getOfflineUsers method

Future<PageUsersOfflineResponse?> getOfflineUsers(
  1. String tenantId,
  2. String urlId, [
  3. GetOfflineUsersOptions? options
])

Past commenters on the page who are NOT currently online. Sorted by displayName. Use this after exhausting /users/online to render a "Members" section. Cursor pagination on commenterName: server walks the partial {tenantId, urlId, commenterName} index from afterName forward via $gt, no $skip cost.

Parameters:

  • String tenantId (required):

  • String urlId (required): Page URL identifier (cleaned server-side).

  • String afterName: Cursor: pass nextAfterName from the previous response.

  • String afterUserId: Cursor tiebreaker: pass nextAfterUserId from the previous response. Required when afterName is set so name-ties don't drop entries.

Implementation

Future<PageUsersOfflineResponse?> getOfflineUsers(String tenantId, String urlId, [ GetOfflineUsersOptions? options ]) async {
  final response = await getOfflineUsersWithHttpInfo(tenantId, urlId, options);
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'PageUsersOfflineResponse',) as PageUsersOfflineResponse;

  }
  return null;
}