getAllFromPerson static method
Will get a PcoCollection
containing ALL PcoCheckInsPersonEvent objects (expecting many)
using a path like this: /check-ins/v2/people/$personId/person_events
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.
This function forces the query.getAll
to be true.
Implementation
static Future<PcoCollection<PcoCheckInsPersonEvent>> getAllFromPerson(
String personId, {
String? id,
PcoCheckInsPersonEventQuery? query,
bool includeAllRelated = false,
bool includeEvent = false,
bool includeFirstCheckIn = false,
bool includeLastCheckIn = false,
bool includePerson = false,
}) async {
query ??= PcoCheckInsPersonEventQuery();
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/people/$personId/person_events';
if (id != null) url += '/$id';
return PcoCollection.fromApiCall<PcoCheckInsPersonEvent>(url,
query: query, apiVersion: kApiVersion);
}