get static method

Future<PcoCollection<PcoCalendarEventInstance>> get({
  1. String? id,
  2. PcoCalendarEventInstanceQuery? query,
  3. bool getAll = false,
  4. bool includeAllRelated = false,
  5. bool includeEvent = false,
  6. bool includeEventTimes = false,
  7. bool includeResourceBookings = false,
  8. bool includeTags = false,
})

Will get a PcoCollection of PcoCalendarEventInstance objects (expecting many) using a path like this: /calendar/v2/event_instances

Available Query Filters:

  • all
  • approved
  • approved_pending
  • approved_pending_rejected
  • approved_rejected
  • approver
  • approver_subscriber
  • future
  • lost
  • owner
  • owner_approver
  • owner_approver_subscriber
  • owner_subscriber
  • pending
  • pending_rejected
  • rejected
  • shared
  • subscriber
  • unresolved

Getting a PcoCollection is useful even when retrieving a single object because it contains error data and helper functions.

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<PcoCollection<PcoCalendarEventInstance>> get({
  String? id,
  PcoCalendarEventInstanceQuery? query,
  bool getAll = false,
  bool includeAllRelated = false,
  bool includeEvent = false,
  bool includeEventTimes = false,
  bool includeResourceBookings = false,
  bool includeTags = false,
}) async {
  query ??= PcoCalendarEventInstanceQuery();
  if (getAll) query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoCalendarEventInstance.canInclude);
  if (includeEvent) query.include.add('event');
  if (includeEventTimes) query.include.add('event_times');
  if (includeResourceBookings) query.include.add('resource_bookings');
  if (includeTags) query.include.add('tags');
  var url = '/calendar/v2/event_instances';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarEventInstance>(url,
      query: query, apiVersion: kApiVersion);
}