Finding.fromJson constructor

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

Implementation

factory Finding.fromJson(Map<String, dynamic> json) {
  return Finding(
    arn: json['arn'] as String,
    attributes: (json['attributes'] as List)
        .whereNotNull()
        .map((e) => Attribute.fromJson(e as Map<String, dynamic>))
        .toList(),
    createdAt: nonNullableTimeStampFromJson(json['createdAt'] as Object),
    updatedAt: nonNullableTimeStampFromJson(json['updatedAt'] as Object),
    userAttributes: (json['userAttributes'] as List)
        .whereNotNull()
        .map((e) => Attribute.fromJson(e as Map<String, dynamic>))
        .toList(),
    assetAttributes: json['assetAttributes'] != null
        ? AssetAttributes.fromJson(
            json['assetAttributes'] as Map<String, dynamic>)
        : null,
    assetType: (json['assetType'] as String?)?.toAssetType(),
    confidence: json['confidence'] as int?,
    description: json['description'] as String?,
    id: json['id'] as String?,
    indicatorOfCompromise: json['indicatorOfCompromise'] as bool?,
    numericSeverity: json['numericSeverity'] as double?,
    recommendation: json['recommendation'] as String?,
    schemaVersion: json['schemaVersion'] as int?,
    service: json['service'] as String?,
    serviceAttributes: json['serviceAttributes'] != null
        ? InspectorServiceAttributes.fromJson(
            json['serviceAttributes'] as Map<String, dynamic>)
        : null,
    severity: (json['severity'] as String?)?.toSeverity(),
    title: json['title'] as String?,
  );
}