ConfigurationItem.fromJson constructor

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

Implementation

factory ConfigurationItem.fromJson(Map<String, dynamic> json) {
  return ConfigurationItem(
    accountId: json['accountId'] as String?,
    arn: json['arn'] as String?,
    availabilityZone: json['availabilityZone'] as String?,
    awsRegion: json['awsRegion'] as String?,
    configuration: json['configuration'] as String?,
    configurationItemCaptureTime:
        timeStampFromJson(json['configurationItemCaptureTime']),
    configurationItemMD5Hash: json['configurationItemMD5Hash'] as String?,
    configurationItemStatus: (json['configurationItemStatus'] as String?)
        ?.toConfigurationItemStatus(),
    configurationStateId: json['configurationStateId'] as String?,
    relatedEvents: (json['relatedEvents'] as List?)
        ?.whereNotNull()
        .map((e) => e as String)
        .toList(),
    relationships: (json['relationships'] as List?)
        ?.whereNotNull()
        .map((e) => Relationship.fromJson(e as Map<String, dynamic>))
        .toList(),
    resourceCreationTime: timeStampFromJson(json['resourceCreationTime']),
    resourceId: json['resourceId'] as String?,
    resourceName: json['resourceName'] as String?,
    resourceType: (json['resourceType'] as String?)?.toResourceType(),
    supplementaryConfiguration:
        (json['supplementaryConfiguration'] as Map<String, dynamic>?)
            ?.map((k, e) => MapEntry(k, e as String)),
    tags: (json['tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    version: json['version'] as String?,
  );
}