listParticipants method

  1. @override
Future<DRPage<ChannelParticipant>> listParticipants(
  1. String channelId, {
  2. String? cursor,
  3. int? limit,
})
override

Implementation

@override
Future<DRPage<ChannelParticipant>> listParticipants(
  String channelId, {
  String? cursor,
  int? limit,
}) async {
  core.requireSignedIn();
  _validateId(channelId);
  final result = await _request(
    'GET',
    '${_path(channelId)}/sessions',
    query: {'cursor': cursor, 'limit': limit},
  );
  return DRPage(
    List.unmodifiable([
      for (final item in asList(result['items']) ?? const [])
        if (asMap(item) != null) ChannelParticipant(freezeMap(asMap(item)!)),
    ]),
    asString(result['next_cursor'])?.isEmpty == true
        ? null
        : asString(result['next_cursor']),
  );
}