getSingle static method

Future<PcoCheckInsOption?> getSingle(
  1. String id, {
  2. PcoCheckInsOptionQuery? query,
  3. bool includeLabel = false,
})

Will get a single PcoCheckInsOption object using a path like this: /check-ins/v2/options/[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<PcoCheckInsOption?> getSingle(
  String id, {
  PcoCheckInsOptionQuery? query,
  bool includeLabel = false,
}) async {
  query ??= PcoCheckInsOptionQuery();

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