getSingleFromEventInstance static method

Future<PcoCalendarEventTime?> getSingleFromEventInstance(
  1. String eventInstanceId,
  2. String id,
  3. {PcoCalendarEventTimeQuery? query,
  4. bool includeEvent = false}
)

Will get a single PcoCalendarEventTime object using a path like this: /calendar/v2/event_instances/$eventInstanceId/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<PcoCalendarEventTime?> getSingleFromEventInstance(
  String eventInstanceId,
  String id, {
  PcoCalendarEventTimeQuery? query,
  bool includeEvent = false,
}) async {
  query ??= PcoCalendarEventTimeQuery();

  if (includeEvent) query.include.add('event');
  var url = '/calendar/v2/event_instances/$eventInstanceId/event_times/$id';
  var retval = await PcoCollection.fromApiCall<PcoCalendarEventTime>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}