initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import 'remote_node.dart';
|
||||
import 'service.dart';
|
||||
|
||||
part 'aggregated_node_status.freezed.dart';
|
||||
part 'aggregated_node_status.g.dart';
|
||||
|
||||
/// Mirrors the anonymous `nodeServices` struct returned by
|
||||
/// `GET /nodes/aggregated`: `{node, services?, error?}`. `error` is the
|
||||
/// *local* API reporting that fetching *this remote* failed (e.g.
|
||||
/// unreachable) — a per-entry condition, distinct from the outer call
|
||||
/// itself failing. Render `error` inline per-card; never conflate it with
|
||||
/// an [ApiException] on the aggregated fetch as a whole.
|
||||
@freezed
|
||||
sealed class AggregatedNodeStatus with _$AggregatedNodeStatus {
|
||||
const factory AggregatedNodeStatus({
|
||||
required RemoteNode node,
|
||||
@Default(<Service>[]) List<Service> services,
|
||||
String? error,
|
||||
}) = _AggregatedNodeStatus;
|
||||
|
||||
factory AggregatedNodeStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$AggregatedNodeStatusFromJson(json);
|
||||
}
|
||||
Reference in New Issue
Block a user