getFromEvent static method
Will get a PcoCollection
of PcoCheckInsPersonEvent objects (expecting many)
using a path like this: /check-ins/v2/events/$eventId/person_events
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<PcoCheckInsPersonEvent>> getFromEvent(
String eventId, {
String? id,
PcoCheckInsPersonEventQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeEvent = false,
bool includeFirstCheckIn = false,
bool includeLastCheckIn = false,
bool includePerson = false,
}) async {
query ??= PcoCheckInsPersonEventQuery();
if (getAll) query.getAll = true;
if (includeAllRelated)
query.include.addAll(PcoCheckInsPersonEvent.canInclude);
if (includeEvent) query.include.add('event');
if (includeFirstCheckIn) query.include.add('first_check_in');
if (includeLastCheckIn) query.include.add('last_check_in');
if (includePerson) query.include.add('person');
var url = '/check-ins/v2/events/$eventId/person_events';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoCheckInsPersonEvent>(url,
query: query, apiVersion: kApiVersion);
}