fromJson static method
Returns a new MmSystemStatusResponse instance and imports its values from
value
if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static MmSystemStatusResponse? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "MmSystemStatusResponse[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "MmSystemStatusResponse[$key]" has a null value in JSON.');
});
return true;
}());
return MmSystemStatusResponse(
androidLatestVersion: mapValueOfType<String>(json, r'AndroidLatestVersion'),
androidMinVersion: mapValueOfType<String>(json, r'AndroidMinVersion'),
desktopLatestVersion: mapValueOfType<String>(json, r'DesktopLatestVersion'),
desktopMinVersion: mapValueOfType<String>(json, r'DesktopMinVersion'),
iosLatestVersion: mapValueOfType<String>(json, r'IosLatestVersion'),
iosMinVersion: mapValueOfType<String>(json, r'IosMinVersion'),
databaseStatus: mapValueOfType<String>(json, r'database_status'),
filestoreStatus: mapValueOfType<String>(json, r'filestore_status'),
status: mapValueOfType<String>(json, r'status'),
canReceiveNotifications: mapValueOfType<String>(json, r'CanReceiveNotifications'),
);
}
return null;
}