getAll static method

Future<PcoCollection<PcoCalendarAttachment>> getAll({
  1. String? id,
  2. PcoCalendarAttachmentQuery? query,
  3. bool includeEvent = false,
})

Will get a PcoCollection containing ALL PcoCalendarAttachment objects (expecting many) using a path like this: /calendar/v2/attachments

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<PcoCalendarAttachment>> getAll({
  String? id,
  PcoCalendarAttachmentQuery? query,
  bool includeEvent = false,
}) async {
  query ??= PcoCalendarAttachmentQuery();
  query.getAll = true;

  if (includeEvent) query.include.add('event');
  var url = '/calendar/v2/attachments';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoCalendarAttachment>(url,
      query: query, apiVersion: kApiVersion);
}