20 lines
630 B
Dart
20 lines
630 B
Dart
import 'package:freezed_annotation/freezed_annotation.dart';
|
|||
|
|
|
||
|
|
part 'backup_execution.freezed.dart';
|
||
|
|
part 'backup_execution.g.dart';
|
||
|
|
|
||
|
|
/// Mirrors `models.BackupExecution`.
|
||
|
|
@freezed
|
||
|
|
sealed class BackupExecution with _$BackupExecution {
|
||
|
|
const factory BackupExecution({
|
||
|
|
required String id,
|
||
|
|
required DateTime timestamp,
|
||
|
|
required bool success,
|
||
|
|
@JsonKey(name: 'duration_seconds') required int durationSeconds,
|
||
|
|
@Default('') String message,
|
||
|
|
@JsonKey(name: 'target_id') String? targetId,
|
||
|
|
}) = _BackupExecution;
|
||
|
|
|
||
|
|
factory BackupExecution.fromJson(Map<String, dynamic> json) => _$BackupExecutionFromJson(json);
|
||
|
|
}
|