getFromSong static method
Will get a PcoCollection
of PcoServicesArrangement objects (expecting many)
using a path like this: /services/v2/songs/$songId/arrangements
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<PcoServicesArrangement>> getFromSong(
String songId, {
String? id,
PcoServicesArrangementQuery? query,
bool getAll = false,
bool includeAllRelated = false,
bool includeKeys = false,
bool includeSections = false,
}) async {
query ??= PcoServicesArrangementQuery();
if (getAll) 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);
}