getSingleFromCheckInAndEventPeriod static method

Future<PcoCheckInsLocationEventPeriod?> getSingleFromCheckInAndEventPeriod(
  1. String checkInId,
  2. String eventPeriodId,
  3. String id, {
  4. PcoCheckInsLocationEventPeriodQuery? query,
  5. bool includeAllRelated = false,
  6. bool includeEventPeriod = false,
  7. bool includeLocation = false,
})

Will get a single PcoCheckInsLocationEventPeriod object using a path like this: /check-ins/v2/check_ins/$checkInId/event_period/$eventPeriodId/location_event_periods/[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<PcoCheckInsLocationEventPeriod?>
    getSingleFromCheckInAndEventPeriod(
  String checkInId,
  String eventPeriodId,
  String id, {
  PcoCheckInsLocationEventPeriodQuery? query,
  bool includeAllRelated = false,
  bool includeEventPeriod = false,
  bool includeLocation = false,
}) async {
  query ??= PcoCheckInsLocationEventPeriodQuery();
  if (includeAllRelated)
    query.include.addAll(PcoCheckInsLocationEventPeriod.canInclude);
  if (includeEventPeriod) query.include.add('event_period');
  if (includeLocation) query.include.add('location');
  var url =
      '/check-ins/v2/check_ins/$checkInId/event_period/$eventPeriodId/location_event_periods/$id';
  var retval =
      await PcoCollection.fromApiCall<PcoCheckInsLocationEventPeriod>(url,
          query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}