getAllFromSong static method

Future<PcoCollection<PcoServicesAttachment>> getAllFromSong(
  1. String songId, {
  2. String? id,
  3. PcoServicesAttachmentQuery? query,
  4. bool includeZooms = false,
})

Will get a PcoCollection containing ALL PcoServicesAttachment objects (expecting many) using a path like this: /services/v2/songs/$songId/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<PcoServicesAttachment>> getAllFromSong(
  String songId, {
  String? id,
  PcoServicesAttachmentQuery? query,
  bool includeZooms = false,
}) async {
  query ??= PcoServicesAttachmentQuery();
  query.getAll = true;

  if (includeZooms) query.include.add('zooms');
  var url = '/services/v2/songs/$songId/attachments';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesAttachment>(url,
      query: query, apiVersion: kApiVersion);
}