ViolationDetail.fromJson constructor

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

Implementation

factory ViolationDetail.fromJson(Map<String, dynamic> json) {
  return ViolationDetail(
    memberAccount: json['MemberAccount'] as String,
    policyId: json['PolicyId'] as String,
    resourceId: json['ResourceId'] as String,
    resourceType: json['ResourceType'] as String,
    resourceViolations: (json['ResourceViolations'] as List)
        .whereNotNull()
        .map((e) => ResourceViolation.fromJson(e as Map<String, dynamic>))
        .toList(),
    resourceDescription: json['ResourceDescription'] as String?,
    resourceTags: (json['ResourceTags'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}