fromJson static method
Returns a new GetV2PageReactUsersResponse instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static GetV2PageReactUsersResponse? 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'userNames'), 'Required key "GetV2PageReactUsersResponse[userNames]" is missing from JSON.');
assert(json[r'userNames'] != null, 'Required key "GetV2PageReactUsersResponse[userNames]" has a null value in JSON.');
assert(json.containsKey(r'status'), 'Required key "GetV2PageReactUsersResponse[status]" is missing from JSON.');
assert(json[r'status'] != null, 'Required key "GetV2PageReactUsersResponse[status]" has a null value in JSON.');
return true;
}());
return GetV2PageReactUsersResponse(
userNames: json[r'userNames'] is Iterable
? (json[r'userNames'] as Iterable).cast<String>().toList(growable: false)
: const [],
status: APIStatus.fromJson(json[r'status'])!,
);
}
return null;
}