Insight.fromJson constructor
Insight.fromJson(
- Map<String, dynamic> json
)
Implementation
factory Insight.fromJson(Map<String, dynamic> json) {
return Insight(
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?,
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(),
);
}