counters method

Future<RoomCounters> counters(
  1. RoomCountersFilter filter,
  2. Authentication authentication
)

Implementation

Future<RoomCounters> counters(
    RoomCountersFilter filter, Authentication authentication) async {
  http.Response response = await _httpService.getWithFilter(
    '/api/v1/im.counters',
    filter,
    authentication,
  );

  if (response.statusCode == 200) {
    if (response.body.isNotEmpty == true) {
      return RoomCounters.fromMap(jsonDecode(response.body));
    } else {
      return RoomCounters();
    }
  }
  throw RocketChatException(response.body);
}