uploadDehydratedDevice method

Future<String> uploadDehydratedDevice({
  1. required String deviceId,
  2. String? initialDeviceDisplayName,
  3. Map<String, dynamic>? deviceData,
  4. MatrixDeviceKeys? deviceKeys,
  5. Map<String, dynamic>? oneTimeKeys,
  6. Map<String, dynamic>? fallbackKeys,
})

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;
}