getSingleFromEvent static method

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

Will get a single PcoCheckInsLocation object using a path like this: /check-ins/v2/events/$eventId/locations/[id]

Available Query Filters:

  • locations
  • root

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<PcoCheckInsLocation?> getSingleFromEvent(
  String eventId,
  String id, {
  PcoCheckInsLocationQuery? query,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeLocations = false,
  bool includeOptions = false,
  bool includeParent = false,
}) async {
  query ??= PcoCheckInsLocationQuery();
  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/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsLocation>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}