get static method

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

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

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