findRecordings method

Future<String> findRecordings({
  1. SearchScope? searchScope,
  2. int? maxMatches,
  3. required int keepAliveTime,
})

FindRecordings starts a search session, looking for recordings that matches the scope (See 20.2.4) defined in the request. Results from the search are acquired using the GetRecordingSearchResults request, specifying the search token returned from this request. The device shall continue searching until one of the following occurs:

  • The entire time range from StartPoint to EndPoint has been searched through.
  • The total number of matches has been found, defined by the MaxMatches parameter.
  • The session has been ended by a client EndSession request.
  • The session has been ended because KeepAliveTime since the last request related to this session has expired. The order of the results is undefined, to allow the device to return results in any order they are found. This operation is mandatory to support for a device implementing the recording search service.

ACCESS CLASS: READ_MEDIA

Implementation

Future<String> findRecordings({
  SearchScope? searchScope,
  int? maxMatches,
  required int keepAliveTime,
}) async {
  loggy.debug('findRecordings');

  final responseEnvelope = await transport.securedRequest(
      uri,
      soap.Body(
        request: SearchRequest.findRecordings(
          searchScope: searchScope,
          maxMatches: maxMatches,
          keepAliveTime: keepAliveTime,
        ),
      ));

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return FindRecordingsResponse.fromJson(responseEnvelope.body.response!)
      .searchToken;
}