getFromCheckInAndLocation static method

Future<PcoCollection<PcoCheckInsOption>> getFromCheckInAndLocation(
  1. String checkInId,
  2. String locationId, {
  3. String? id,
  4. PcoCheckInsOptionQuery? query,
  5. bool getAll = false,
  6. bool includeLabel = false,
})

Will get a PcoCollection of PcoCheckInsOption objects (expecting many) using a path like this: /check-ins/v2/check_ins/$checkInId/locations/$locationId/options

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<PcoCheckInsOption>> getFromCheckInAndLocation(
  String checkInId,
  String locationId, {
  String? id,
  PcoCheckInsOptionQuery? query,
  bool getAll = false,
  bool includeLabel = false,
}) async {
  query ??= PcoCheckInsOptionQuery();
  if (getAll) query.getAll = true;

  if (includeLabel) query.include.add('label');
  var url =
      '/check-ins/v2/check_ins/$checkInId/locations/$locationId/options';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCheckInsOption>(url,
      query: query, apiVersion: kApiVersion);
}