hereNow method

Future<HereNowResult> hereNow({
  1. Keyset? keyset,
  2. String? using,
  3. Set<String> channels = const {},
  4. Set<String> channelGroups = const {},
  5. StateInfo? stateInfo,
})
inherited

Gets the occupancy information from a list of channels and/or channelGroups.

If stateInfo is .none, then it will only return occupancy counts. If stateInfo is .all, then it will include each UUIDs state. If stateInfo is .onlyUUIDs (as by default), then it will include UUIDs without state.

Implementation

Future<HereNowResult> hereNow(
    {Keyset? keyset,
    String? using,
    Set<String> channels = const {},
    Set<String> channelGroups = const {},
    StateInfo? stateInfo}) async {
  keyset ??= keysets[using];

  Ensure(keyset).isNotNull('keyset');

  var params = HereNowParams(keyset,
      channels: channels, channelGroups: channelGroups, stateInfo: stateInfo);

  return defaultFlow<HereNowParams, HereNowResult>(
      keyset: keyset,
      core: this,
      params: params,
      serialize: (object, [_]) => HereNowResult.fromJson(object,
          channelName: (channels.length == 1) ? channels.first : null));
}