DescribeNotificationRuleResult.fromJson constructor Null safety

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

Implementation

factory DescribeNotificationRuleResult.fromJson(Map<String, dynamic> json) {
  return DescribeNotificationRuleResult(
    arn: json['Arn'] as String,
    createdBy: json['CreatedBy'] as String?,
    createdTimestamp: timeStampFromJson(json['CreatedTimestamp']),
    detailType: (json['DetailType'] as String?)?.toDetailType(),
    eventTypes: (json['EventTypes'] as List?)
        ?.whereNotNull()
        .map((e) => EventTypeSummary.fromJson(e as Map<String, dynamic>))
        .toList(),
    lastModifiedTimestamp: timeStampFromJson(json['LastModifiedTimestamp']),
    name: json['Name'] as String?,
    resource: json['Resource'] as String?,
    status: (json['Status'] as String?)?.toNotificationRuleStatus(),
    tags: (json['Tags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    targets: (json['Targets'] as List?)
        ?.whereNotNull()
        .map((e) => TargetSummary.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}