getPresets method

Future<List<ImagingPreset>> getPresets(
  1. String videoSourceToken, {
  2. int? limit = 100,
})

Via this command the list of available Imaging Presets can be requested.

ACCESS CLASS: READ_MEDIA

Implementation

Future<List<ImagingPreset>> getPresets(String videoSourceToken,
    {int? limit = 100}) async {
  loggy.debug('getPresets');

  final responseEnvelope = await transport.securedRequest(
      uri,
      soap.Body(
        request: ImagingRequest.getPresets(videoSourceToken),
      ));

  if (responseEnvelope.body.response == null) throw Exception();

  final presets =
      GetPresetsResponse.fromJson(responseEnvelope.body.response!).presets;

  limit = (limit! > presets.length) ? presets.length : limit;

  return GetPresetsResponse.fromJson(responseEnvelope.body.response!)
      .presets
      .sublist(0, limit);
}