DeviceProductData.fromJson constructor

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

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] ?? "",
  );
}