2022-05-24 16:09:47 +00:00
|
|
|
import 'package:equatable/equatable.dart';
|
2022-05-09 23:16:36 +00:00
|
|
|
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({
|
2022-05-09 23:16:36 +00:00
|
|
|
required this.exists,
|
|
|
|
required this.valid,
|
|
|
|
this.date,
|
|
|
|
this.expiration,
|
2022-05-24 16:09:47 +00:00
|
|
|
this.usesLeft,
|
2022-05-09 23:16:36 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
final bool exists;
|
|
|
|
final DateTime? date;
|
|
|
|
final DateTime? expiration;
|
2022-05-24 16:09:47 +00:00
|
|
|
@JsonKey(name: 'uses_left')
|
|
|
|
final int? usesLeft;
|
2022-05-09 23:16:36 +00:00
|
|
|
final bool valid;
|
|
|
|
|
2022-05-24 16:09:47 +00:00
|
|
|
@override
|
|
|
|
List<Object?> get props => [
|
|
|
|
exists,
|
|
|
|
date,
|
|
|
|
expiration,
|
|
|
|
usesLeft,
|
|
|
|
valid,
|
|
|
|
];
|
2022-05-09 23:16:36 +00:00
|
|
|
}
|