decodeCapacity static method
Decode server capacity
Implementation
static ServerCapacity decodeCapacity(Uint8List bytes) {
final json = utf8.decode(bytes);
final data = jsonDecode(json) as Map<String, dynamic>;
return ServerCapacity(
totalStorageBytes: data['totalStorageBytes'] as int,
usedStorageBytes: data['usedStorageBytes'] as int,
availableStorageBytes: data['availableStorageBytes'] as int,
messageCount: data['messageCount'] as int,
activeMailboxes: data['activeMailboxes'] as int,
healthScore: (data['healthScore'] as num).toDouble(),
);
}