getSecret method

Future<FileContent?> getSecret({
  1. required String secretId,
  2. String? delegatedTo,
})

Implementation

Future<FileContent?> getSecret({required String secretId, String? delegatedTo}) async {
  final req = <String, dynamic>{"secret_id": secretId, if (delegatedTo != null) "delegated_to": delegatedTo};

  final res = await room.sendRequest("secrets.get_secret", req);
  if (res is EmptyContent) {
    return null;
  }
  if (res is FileContent) {
    return res;
  }
  throw RoomServerException("Invalid response received, expected FileContent or EmptyContent");
}