deleteRoomKeysVersion method

Future<void> deleteRoomKeysVersion(
  1. String version
)

Delete an existing key backup. Both the information about the backup, as well as all key data related to the backup will be deleted.

version The backup version to delete, as returned in the version parameter in the response of POST /_matrix/client/v3/room_keys/version or GET /_matrix/client/v3/room_keys/version/{version}.

Implementation

Future<void> deleteRoomKeysVersion(String version) async {
  final requestUri = Uri(
    path:
        '_matrix/client/v3/room_keys/version/${Uri.encodeComponent(version)}',
  );
  final request = Request('DELETE', baseUri!.resolveUri(requestUri));
  request.headers['authorization'] = 'Bearer ${bearerToken!}';
  final response = await httpClient.send(request);
  final responseBody = await response.stream.toBytes();
  if (response.statusCode != 200) unexpectedResponse(response, responseBody);
  final responseString = utf8.decode(responseBody);
  final json = jsonDecode(responseString);
  return ignore(json);
}