InsightSummary.fromJson constructor

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

Implementation

factory InsightSummary.fromJson(Map<String, dynamic> json) {
  return InsightSummary(
    categories: (json['Categories'] as List?)
        ?.whereNotNull()
        .map((e) => (e as String).toInsightCategory())
        .toList(),
    clientRequestImpactStatistics:
        json['ClientRequestImpactStatistics'] != null
            ? RequestImpactStatistics.fromJson(
                json['ClientRequestImpactStatistics'] as Map<String, dynamic>)
            : null,
    endTime: timeStampFromJson(json['EndTime']),
    groupARN: json['GroupARN'] as String?,
    groupName: json['GroupName'] as String?,
    insightId: json['InsightId'] as String?,
    lastUpdateTime: timeStampFromJson(json['LastUpdateTime']),
    rootCauseServiceId: json['RootCauseServiceId'] != null
        ? ServiceId.fromJson(
            json['RootCauseServiceId'] as Map<String, dynamic>)
        : null,
    rootCauseServiceRequestImpactStatistics:
        json['RootCauseServiceRequestImpactStatistics'] != null
            ? RequestImpactStatistics.fromJson(
                json['RootCauseServiceRequestImpactStatistics']
                    as Map<String, dynamic>)
            : null,
    startTime: timeStampFromJson(json['StartTime']),
    state: (json['State'] as String?)?.toInsightState(),
    summary: json['Summary'] as String?,
    topAnomalousServices: (json['TopAnomalousServices'] as List?)
        ?.whereNotNull()
        .map((e) => AnomalousService.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}