BackupRule.fromJson constructor

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

Implementation

factory BackupRule.fromJson(Map<String, dynamic> json) {
  return BackupRule(
    ruleName: json['RuleName'] as String,
    targetBackupVaultName: json['TargetBackupVaultName'] as String,
    completionWindowMinutes: json['CompletionWindowMinutes'] as int?,
    copyActions: (json['CopyActions'] as List?)
        ?.whereNotNull()
        .map((e) => CopyAction.fromJson(e as Map<String, dynamic>))
        .toList(),
    lifecycle: json['Lifecycle'] != null
        ? Lifecycle.fromJson(json['Lifecycle'] as Map<String, dynamic>)
        : null,
    recoveryPointTags: (json['RecoveryPointTags'] as Map<String, dynamic>?)
        ?.map((k, e) => MapEntry(k, e as String)),
    ruleId: json['RuleId'] as String?,
    scheduleExpression: json['ScheduleExpression'] as String?,
    startWindowMinutes: json['StartWindowMinutes'] as int?,
  );
}