Backup.fromJson constructor

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

Implementation

factory Backup.fromJson(Map<String, dynamic> json) {
  return Backup(
    backupId: json['BackupId'] as String,
    backupState: (json['BackupState'] as String?)?.toBackupState(),
    clusterId: json['ClusterId'] as String?,
    copyTimestamp: timeStampFromJson(json['CopyTimestamp']),
    createTimestamp: timeStampFromJson(json['CreateTimestamp']),
    deleteTimestamp: timeStampFromJson(json['DeleteTimestamp']),
    neverExpires: json['NeverExpires'] as bool?,
    sourceBackup: json['SourceBackup'] as String?,
    sourceCluster: json['SourceCluster'] as String?,
    sourceRegion: json['SourceRegion'] as String?,
    tagList: (json['TagList'] as List?)
        ?.whereNotNull()
        .map((e) => Tag.fromJson(e as Map<String, dynamic>))
        .toList(),
  );
}