fromJson static method
Implementation
@visibleForTesting
static SearchPerson? fromJson(Map<String, dynamic>? jsonObject) {
if (jsonObject == null) return null;
var result = SearchPerson._privateConstructor();
if (jsonObject["images"] != null) {
for (var item in jsonObject["images"]) {
result._images.add(SearchPersonImage.fromJson(item)!);
}
}
result._detection = SearchPersonDetection.fromJson(jsonObject["detection"]);
result.name = result.name = jsonObject["name"];
result.updatedAt = DateTime.parse(jsonObject["updatedAt"]);
result.groups = (jsonObject["groups"] as List).cast<String>();
result.id = jsonObject["id"];
result.metadata = jsonObject["metadata"];
result._createdAt = DateTime.parse(jsonObject["createdAt"]);
result.externalId = jsonObject["externalId"];
result.expireAt = switch (jsonObject['expireAt']) { String s => DateTime.parse(s), _ => null };
result.ttl = jsonObject["ttl"];
return result;
}