expandRoomVolume method
Implementation
Future<StorageVolume> expandRoomVolume({
required String projectId,
required String roomName,
required String volumeId,
required int maxSizeMb,
}) async {
final encodedProjectId = Uri.encodeComponent(projectId);
final encodedRoomName = Uri.encodeComponent(roomName);
final encodedVolumeId = Uri.encodeComponent(volumeId);
final uri = Uri.parse(
'$baseUrl/accounts/projects/$encodedProjectId/rooms/'
'$encodedRoomName/volumes/$encodedVolumeId',
);
final response = await httpClient.patch(uri, body: jsonEncode({'max_size_mb': maxSizeMb}));
if (response.statusCode >= 400) {
throw MeshagentException(
'Failed to expand room volume. '
'Status code: ${response.statusCode}, body: ${response.body}',
);
}
return StorageVolume.fromJson(jsonDecode(response.body) as Map<String, dynamic>);
}