2026-05-27 19:06:09 -04:00
|
|
|
import 'device_type.dart';
|
|
|
|
|
|
2026-05-27 14:58:11 -04:00
|
|
|
class Device {
|
|
|
|
|
final String macAddress;
|
|
|
|
|
final String ipv4Address;
|
|
|
|
|
final String vendor;
|
|
|
|
|
final DateTime lastSeen;
|
|
|
|
|
final bool isRegistered;
|
|
|
|
|
final String owner;
|
2026-05-27 19:06:09 -04:00
|
|
|
final DeviceType deviceType;
|
2026-05-30 11:09:55 -04:00
|
|
|
final String? name;
|
2026-05-27 14:58:11 -04:00
|
|
|
|
|
|
|
|
Device({
|
|
|
|
|
required this.macAddress,
|
|
|
|
|
required this.ipv4Address,
|
|
|
|
|
required this.vendor,
|
|
|
|
|
required this.lastSeen,
|
|
|
|
|
required this.isRegistered,
|
|
|
|
|
required this.owner,
|
|
|
|
|
required this.deviceType,
|
2026-05-30 11:09:55 -04:00
|
|
|
this.name,
|
2026-05-27 14:58:11 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Device.fromJson(Map<String, dynamic> json)
|
|
|
|
|
: macAddress = json['mac_address'] as String,
|
|
|
|
|
ipv4Address = json['ipv4_address'] as String,
|
|
|
|
|
vendor = json['vendor'] as String,
|
|
|
|
|
lastSeen = DateTime.parse(json['last_seen'] as String),
|
|
|
|
|
isRegistered = json['is_registered'] as bool,
|
|
|
|
|
owner = json['owner'] as String,
|
2026-05-30 11:09:55 -04:00
|
|
|
deviceType = DeviceType.fromString(json['device_type'] as String),
|
|
|
|
|
name = json['name'] as String?;
|
2026-05-27 14:58:11 -04:00
|
|
|
}
|