selfprivacy.org.app/lib/logic/models/json/recovery_token_status.dart

34 lines
742 B
Dart
Raw Normal View History

2022-05-24 16:09:47 +00:00
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'recovery_token_status.g.dart';
@JsonSerializable()
2022-05-24 16:09:47 +00:00
class RecoveryKeyStatus extends Equatable {
2022-06-05 19:36:32 +00:00
factory RecoveryKeyStatus.fromJson(final Map<String, dynamic> json) =>
_$RecoveryKeyStatusFromJson(json);
2022-05-24 18:55:39 +00:00
const RecoveryKeyStatus({
required this.exists,
required this.valid,
this.date,
this.expiration,
2022-05-24 16:09:47 +00:00
this.usesLeft,
});
final bool exists;
final DateTime? date;
final DateTime? expiration;
2022-05-24 16:09:47 +00:00
@JsonKey(name: 'uses_left')
final int? usesLeft;
final bool valid;
2022-05-24 16:09:47 +00:00
@override
List<Object?> get props => [
exists,
date,
expiration,
usesLeft,
valid,
];
}