getPagesPublic method

Future<GetPublicPagesResponse?> getPagesPublic(
  1. String tenantId, [
  2. GetPagesPublicOptions? options
])

List pages for a tenant. Used by the FChat desktop client to populate its room list. Requires enableFChat to be true on the resolved custom config for each page. Pages that require SSO are filtered against the requesting user's group access.

Parameters:

  • String tenantId (required):

  • String cursor: Opaque pagination cursor returned as nextCursor from a prior request. Tied to the same sortBy.

  • int limit: 1..200, default 50

  • String q: Optional case-insensitive title prefix filter.

  • PagesSortBy sortBy: Sort order. updatedAt (default, newest first), commentCount (most comments first), or title (alphabetical).

  • bool hasComments: If true, only return pages with at least one comment.

Implementation

Future<GetPublicPagesResponse?> getPagesPublic(String tenantId, [ GetPagesPublicOptions? options ]) async {
  final response = await getPagesPublicWithHttpInfo(tenantId, 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), 'GetPublicPagesResponse',) as GetPublicPagesResponse;

  }
  return null;
}