Finding.fromJson constructor

Finding.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory Finding.fromJson(Map<String, dynamic> json) {
  return Finding(
    analyzedAt: nonNullableTimeStampFromJson(json['analyzedAt'] as Object),
    condition: (json['condition'] as Map<String, dynamic>)
        .map((k, e) => MapEntry(k, e as String)),
    createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object),
    id: json['id'] as String,
    resourceOwnerAccount: json['resourceOwnerAccount'] as String,
    resourceType: (json['resourceType'] as String).toResourceType(),
    status: (json['status'] as String).toFindingStatus(),
    updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object),
    action: (json['action'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    error: json['error'] as String?,
    isPublic: json['isPublic'] as bool?,
    principal: (json['principal'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    resource: json['resource'] as String?,
    sources: (json['sources'] as List?)
        ?.whereNotNull()
        .map((e) => FindingSource.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}