getAllFromEvent static method

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

Will get a PcoCollection containing ALL PcoCalendarAttachment objects (expecting many) using a path like this: /calendar/v2/events/$eventId/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>> getAllFromEvent(
  String eventId, {
  String? id,
  PcoCalendarAttachmentQuery? query,
  bool includeEvent = false,
}) async {
  query ??= PcoCalendarAttachmentQuery();
  query.getAll = true;

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