getAllFromCheckIn static method

Future<PcoCollection<PcoCheckInsLocation>> getAllFromCheckIn(
  1. String checkInId,
  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 PcoCollection containing ALL PcoCheckInsLocation objects (expecting many) using a path like this: /check-ins/v2/check_ins/$checkInId/locations

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<PcoCheckInsLocation>> getAllFromCheckIn(
  String checkInId, {
  String? id,
  PcoCheckInsLocationQuery? query,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeLocations = false,
  bool includeOptions = false,
  bool includeParent = false,
}) async {
  query ??= PcoCheckInsLocationQuery();
  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/check_ins/$checkInId/locations';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsLocation>(url,
      query: query, apiVersion: kApiVersion);
}