fromJson static method
Returns a new GetV1PageLikes instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static GetV1PageLikes? 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(() {
assert(json.containsKey(r'urlIdWS'), 'Required key "GetV1PageLikes[urlIdWS]" is missing from JSON.');
assert(json[r'urlIdWS'] != null, 'Required key "GetV1PageLikes[urlIdWS]" has a null value in JSON.');
assert(json.containsKey(r'didLike'), 'Required key "GetV1PageLikes[didLike]" is missing from JSON.');
assert(json[r'didLike'] != null, 'Required key "GetV1PageLikes[didLike]" has a null value in JSON.');
assert(json.containsKey(r'commentCount'), 'Required key "GetV1PageLikes[commentCount]" is missing from JSON.');
assert(json[r'commentCount'] != null, 'Required key "GetV1PageLikes[commentCount]" has a null value in JSON.');
assert(json.containsKey(r'likeCount'), 'Required key "GetV1PageLikes[likeCount]" is missing from JSON.');
assert(json[r'likeCount'] != null, 'Required key "GetV1PageLikes[likeCount]" has a null value in JSON.');
assert(json.containsKey(r'status'), 'Required key "GetV1PageLikes[status]" is missing from JSON.');
assert(json[r'status'] != null, 'Required key "GetV1PageLikes[status]" has a null value in JSON.');
return true;
}());
return GetV1PageLikes(
urlIdWS: mapValueOfType<String>(json, r'urlIdWS')!,
didLike: mapValueOfType<bool>(json, r'didLike')!,
commentCount: mapValueOfType<int>(json, r'commentCount')!,
likeCount: mapValueOfType<int>(json, r'likeCount')!,
status: APIStatus.fromJson(json[r'status'])!,
);
}
return null;
}