getFromEventAndAttendance static method

Future<PcoCollection<PcoGroupsPerson>> getFromEventAndAttendance(
  1. String eventId,
  2. String attendanceId, {
  3. String? id,
  4. PcoGroupsPersonQuery? query,
  5. bool getAll = false,
})

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

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<PcoGroupsPerson>> getFromEventAndAttendance(
  String eventId,
  String attendanceId, {
  String? id,
  PcoGroupsPersonQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoGroupsPersonQuery();
  if (getAll) query.getAll = true;

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