getSingle static method

Future<PcoServicesMedia?> getSingle(
  1. String id, {
  2. PcoServicesMediaQuery? query,
  3. bool includeAttachments = false,
})

Will get a single PcoServicesMedia object using a path like this: /services/v2/media/[id]

Available Query Filters:

  • archived
  • audio
  • background_audio
  • background_image
  • background_video
  • countdown
  • document
  • drama
  • image
  • not_archived
  • powerpoint
  • song_video
  • video

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<PcoServicesMedia?> getSingle(
  String id, {
  PcoServicesMediaQuery? query,
  bool includeAttachments = false,
}) async {
  query ??= PcoServicesMediaQuery();

  if (includeAttachments) query.include.add('attachments');
  var url = '/services/v2/media/$id';
  var retval = await PcoCollection.fromApiCall<PcoServicesMedia>(url,
      query: query, apiVersion: kApiVersion);
  return retval.items.isEmpty ? null : retval.items.first;
}