

class DeviceModel {
  final String id;
  final String endpoint;
  final String status;
  final String connectionState;
  final String lastActivityTime;

  const DeviceModel(
      {required this.id,
      required this.endpoint,
      required this.status,
      required this.connectionState,
      required this.lastActivityTime});

  factory DeviceModel.fromJson(Map<String, dynamic> parsedJson) {
    return DeviceModel(
        id: parsedJson['id'].toString(),
        endpoint: parsedJson['endpoint'],
        status: parsedJson['status'],
        connectionState: parsedJson['connectionState'],
        lastActivityTime: parsedJson['lastActivityTime']);
  }

  @override
  String toString() {
    return "{"
        "id: $id, "
        "endpoint: $endpoint, "
        "status: $status, "
        "connectionState: $connectionState, "
        "lastActivityTime: $lastActivityTime, "
        "}";
  }
}
