getSingleFromEventTime static method

Future<PcoCheckInsLocationEventTime?> getSingleFromEventTime(
  1. String eventTimeId,
  2. String id, {
  3. PcoCheckInsLocationEventTimeQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeEventTime = false,
  6. bool includeLocation = false,
})

Will get a single PcoCheckInsLocationEventTime object using a path like this: /check-ins/v2/event_times/$eventTimeId/location_event_times/[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<PcoCheckInsLocationEventTime?> getSingleFromEventTime(
  String eventTimeId,
  String id, {
  PcoCheckInsLocationEventTimeQuery? query,
  bool includeAllRelated = false,
  bool includeEventTime = false,
  bool includeLocation = false,
}) async {
  query ??= PcoCheckInsLocationEventTimeQuery();
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsLocationEventTime.canInclude);
  if (includeEventTime) query.include.add('event_time');
  if (includeLocation) query.include.add('location');
  var url = '/check-ins/v2/event_times/$eventTimeId/location_event_times/$id';
  var retval = await PcoCollection.fromApiCall<PcoCheckInsLocationEventTime>(
      url,
      query: query,
      apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}