getFromEvent static method

Future<PcoCollection<PcoGroupsAttendance>> getFromEvent(
  1. String eventId, {
  2. String? id,
  3. PcoGroupsAttendanceQuery? query,
  4. bool getAll = false,
  5. bool includePerson = false,
})

Will get a PcoCollection of PcoGroupsAttendance objects (expecting many) using a path like this: /groups/v2/events/$eventId/attendances

Available Query Filters:

  • attended

Getting a PcoCollection is useful even when retrieving a single object because it contains error data and helper functions.

Additional options may be specified by using the query argument, but some query options are also available as boolean flags in this function call too.

Implementation

static Future<PcoCollection<PcoGroupsAttendance>> getFromEvent(
  String eventId, {
  String? id,
  PcoGroupsAttendanceQuery? query,
  bool getAll = false,
  bool includePerson = false,
}) async {
  query ??= PcoGroupsAttendanceQuery();
  if (getAll) query.getAll = true;

  if (includePerson) query.include.add('person');
  var url = '/groups/v2/events/$eventId/attendances';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoGroupsAttendance>(url,
      query: query, apiVersion: kApiVersion);
}