22 lines
663 B
Dart
22 lines
663 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|||
|
|
|
||
|
|
part 'remote_node.freezed.dart';
|
||
|
|
part 'remote_node.g.dart';
|
||
|
|
|
||
|
|
/// Mirrors `models.RemoteNode` — an entry in this node's registry of
|
||
|
|
/// sibling NodeMaster hosts (`/nodes/*`).
|
||
|
|
@freezed
|
||
|
|
sealed class RemoteNode with _$RemoteNode {
|
||
|
|
const factory RemoteNode({
|
||
|
|
@Default('') String id,
|
||
|
|
required String name,
|
||
|
|
required String url,
|
||
|
|
@Default('') String status,
|
||
|
|
String? description,
|
||
|
|
@Default(<String>[]) List<String> tags,
|
||
|
|
@JsonKey(name: 'last_seen') DateTime? lastSeen,
|
||
|
|
}) = _RemoteNode;
|
||
|
|
|
||
|
|
factory RemoteNode.fromJson(Map<String, dynamic> json) => _$RemoteNodeFromJson(json);
|
||
|
|
}
|