getAllFromTag static method

Future<PcoCollection<PcoCalendarEvent>> getAllFromTag(
  1. String tagId,
  2. {String? id,
  3. PcoCalendarEventQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeAttachments = false,
  6. bool includeOwner = false,
  7. bool includeTags = false}
)

Will get a PcoCollection containing ALL PcoCalendarEvent objects (expecting many) using a path like this: /calendar/v2/tags/$tagId/events

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.

This function forces the query.getAll to be true.

Implementation

static Future<PcoCollection<PcoCalendarEvent>> getAllFromTag(
  String tagId, {
  String? id,
  PcoCalendarEventQuery? query,
  bool includeAllRelated = false,
  bool includeAttachments = false,
  bool includeOwner = false,
  bool includeTags = false,
}) async {
  query ??= PcoCalendarEventQuery();
  query.getAll = true;
  if (includeAllRelated) query.include.addAll(PcoCalendarEvent.canInclude);
  if (includeAttachments) query.include.add('attachments');
  if (includeOwner) query.include.add('owner');
  if (includeTags) query.include.add('tags');
  var url = '/calendar/v2/tags/$tagId/events';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarEvent>(url,
      query: query, apiVersion: kApiVersion);
}