DeviceProductData.fromJson constructor
Creates a DeviceProductData object from the JSON response to a GET request.
Implementation
factory DeviceProductData.fromJson(Map<String, dynamic> dataMap) {
return DeviceProductData(
modelId: dataMap[ApiFields.modelId] ?? "",
manufacturerName: dataMap[ApiFields.manufacturerName] ?? "",
productName: dataMap[ApiFields.productName] ?? "",
productArchetype:
DeviceArchetype.fromString(dataMap[ApiFields.productArchetype] ?? ""),
isCertified: dataMap[ApiFields.isCertified] ?? false,
softwareVersion: dataMap[ApiFields.softwareVersion] ?? "0.0.0",
hardwarePlatformType: dataMap[ApiFields.hardwarePlatformType] ?? "",
);
}