InstanceRecommendation.fromJson constructor
InstanceRecommendation.fromJson(
- Map<String, dynamic> json
)
Implementation
factory InstanceRecommendation.fromJson(Map<String, dynamic> json) {
return InstanceRecommendation(
accountId: json['accountId'] as String?,
currentInstanceType: json['currentInstanceType'] as String?,
finding: (json['finding'] as String?)?.toFinding(),
instanceArn: json['instanceArn'] as String?,
instanceName: json['instanceName'] as String?,
lastRefreshTimestamp: timeStampFromJson(json['lastRefreshTimestamp']),
lookBackPeriodInDays: json['lookBackPeriodInDays'] as double?,
recommendationOptions: (json['recommendationOptions'] as List?)
?.whereNotNull()
.map((e) =>
InstanceRecommendationOption.fromJson(e as Map<String, dynamic>))
.toList(),
recommendationSources: (json['recommendationSources'] as List?)
?.whereNotNull()
.map((e) => RecommendationSource.fromJson(e as Map<String, dynamic>))
.toList(),
utilizationMetrics: (json['utilizationMetrics'] as List?)
?.whereNotNull()
.map((e) => UtilizationMetric.fromJson(e as Map<String, dynamic>))
.toList(),
);
}