getSingle static method

Future<PcoCheckInsPass?> getSingle(
  1. String id, {
  2. PcoCheckInsPassQuery? query,
  3. bool includePerson = false,
})

Will get a single PcoCheckInsPass object using a path like this: /check-ins/v2/passes/[id]

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<PcoCheckInsPass?> getSingle(
  String id, {
  PcoCheckInsPassQuery? query,
  bool includePerson = false,
}) async {
  query ??= PcoCheckInsPassQuery();

  if (includePerson) query.include.add('person');
  var url = '/check-ins/v2/passes/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsPass>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}