getAllFromSong static method

Future<PcoCollection<PcoServicesArrangement>> getAllFromSong(
  1. String songId, {
  2. String? id,
  3. PcoServicesArrangementQuery? query,
  4. bool includeAllRelated = false,
  5. bool includeKeys = false,
  6. bool includeSections = false,
})

Will get a PcoCollection containing ALL PcoServicesArrangement objects (expecting many) using a path like this: /services/v2/songs/$songId/arrangements

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<PcoServicesArrangement>> getAllFromSong(
  String songId, {
  String? id,
  PcoServicesArrangementQuery? query,
  bool includeAllRelated = false,
  bool includeKeys = false,
  bool includeSections = false,
}) async {
  query ??= PcoServicesArrangementQuery();
  query.getAll = true;
  if (includeAllRelated)
    query.include.addAll(PcoServicesArrangement.canInclude);
  if (includeKeys) query.include.add('keys');
  if (includeSections) query.include.add('sections');
  var url = '/services/v2/songs/$songId/arrangements';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesArrangement>(url,
      query: query, apiVersion: kApiVersion);
}