getAllFromMedia static method

Will get a PcoCollection containing ALL PcoServicesMediaSchedule objects (expecting many) using a path like this: /services/v2/media/$mediaId/media_schedules

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<PcoServicesMediaSchedule>> getAllFromMedia(
  String mediaId, {
  String? id,
  PcoServicesMediaScheduleQuery? query,
}) async {
  query ??= PcoServicesMediaScheduleQuery();
  query.getAll = true;

  var url = '/services/v2/media/$mediaId/media_schedules';
  if (id != null) url += '/$id';
  return PcoCollection.fromApiCall<PcoServicesMediaSchedule>(url,
      query: query, apiVersion: kApiVersion);
}