DeviceMetadata.fromJson constructor

DeviceMetadata.fromJson(
  1. Map<String, dynamic> dataMap
)

Creates a DeviceMetadata object from the JSON response to a GET request.

Implementation

factory DeviceMetadata.fromJson(Map<String, dynamic> dataMap) {
  return DeviceMetadata(
    name: dataMap[ApiFields.name] ?? "",
    archetype: DeviceArchetype.fromString(dataMap[ApiFields.archetype] ?? ""),
  );
}