getFromEvent static method

Future<PcoCollection<PcoCheckInsLocation>> getFromEvent(
  1. String eventId, {
  2. String? id,
  3. PcoCheckInsLocationQuery? query,
  4. bool getAll = false,
  5. bool includeAllRelated = false,
  6. bool includeEvent = false,
  7. bool includeLocations = false,
  8. bool includeOptions = false,
  9. bool includeParent = false,
})

Will get a PcoCollection of PcoCheckInsLocation objects (expecting many) using a path like this: /check-ins/v2/events/$eventId/locations

Available Query Filters:

  • locations
  • root

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<PcoCheckInsLocation>> getFromEvent(
  String eventId, {
  String? id,
  PcoCheckInsLocationQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeLocations = false,
  bool includeOptions = false,
  bool includeParent = false,
}) async {
  query ??= PcoCheckInsLocationQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoCheckInsLocation.canInclude);
  if (includeEvent) query.include.add('event');
  if (includeLocations) query.include.add('locations');
  if (includeOptions) query.include.add('options');
  if (includeParent) query.include.add('parent');
  var url = '/check-ins/v2/events/$eventId/locations';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsLocation>(url,
      query: query, apiVersion: kApiVersion);
}