uploadDehydratedDevice method
uploads a dehydrated device. https://github.com/matrix-org/matrix-spec-proposals/pull/3814
Implementation
Future<String> uploadDehydratedDevice({
required String deviceId,
String? initialDeviceDisplayName,
Map<String, dynamic>? deviceData,
MatrixDeviceKeys? deviceKeys,
Map<String, dynamic>? oneTimeKeys,
Map<String, dynamic>? fallbackKeys,
}) async {
final response = await request(
RequestType.PUT,
'/client/unstable/org.matrix.msc3814.v1/dehydrated_device',
data: {
'device_id': deviceId,
if (initialDeviceDisplayName != null)
'initial_device_display_name': initialDeviceDisplayName,
if (deviceData != null) 'device_data': deviceData,
if (deviceKeys != null) 'device_keys': deviceKeys.toJson(),
if (oneTimeKeys != null) 'one_time_keys': oneTimeKeys,
if (fallbackKeys != null) ...{
'fallback_keys': fallbackKeys,
},
},
);
return response['device_id'] as String;
}