getKeysFromSongAndArrangement static method

Future<PcoCollection<PcoServicesKey>> getKeysFromSongAndArrangement(
  1. String songId,
  2. String arrangementId, {
  3. PcoServicesKeyQuery? query,
  4. bool getAll = false,
})

Will get a PcoCollection of PcoServicesKey objects (expecting one) using a path like this: /services/v2/songs/$songId/arrangements/$arrangementId/keys

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<PcoServicesKey>> getKeysFromSongAndArrangement(
  String songId,
  String arrangementId, {
  PcoServicesKeyQuery? query,
  bool getAll = false,
}) async {
  query ??= PcoServicesKeyQuery();
  if (getAll) query.getAll = true;

  var url = '/services/v2/songs/$songId/arrangements/$arrangementId/keys';

  return PcoCollection.fromApiCall<PcoServicesKey>(url,
      query: query, apiVersion: kApiVersion);
}