import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:solian/models/account.dart'; part 'auth.g.dart'; @JsonSerializable() class AuthResult { bool isFinished; AuthTicket ticket; AuthResult({ required this.isFinished, required this.ticket, }); factory AuthResult.fromJson(Map json) => _$AuthResultFromJson(json); Map toJson() => _$AuthResultToJson(this); } @JsonSerializable() class AuthTicket { int id; DateTime createdAt; DateTime updatedAt; DateTime? deletedAt; String location; String ipAddress; String userAgent; int stepRemain; List claims; List audiences; @JsonKey(defaultValue: []) List factorTrail; String? grantToken; String? accessToken; String? refreshToken; DateTime? expiredAt; DateTime? availableAt; DateTime? lastGrantAt; String? nonce; int? clientId; Account account; int accountId; AuthTicket({ required this.id, required this.createdAt, required this.updatedAt, required this.deletedAt, required this.location, required this.ipAddress, required this.userAgent, required this.stepRemain, required this.claims, required this.audiences, required this.factorTrail, required this.grantToken, required this.accessToken, required this.refreshToken, required this.expiredAt, required this.availableAt, required this.lastGrantAt, required this.nonce, required this.clientId, required this.account, required this.accountId, }); factory AuthTicket.fromJson(Map json) => _$AuthTicketFromJson(json); Map toJson() => _$AuthTicketToJson(this); } @JsonSerializable() class AuthFactor { int id; DateTime createdAt; DateTime updatedAt; DateTime? deletedAt; int type; Map? config; Account account; int accountId; AuthFactor({ required this.id, required this.createdAt, required this.updatedAt, required this.deletedAt, required this.type, required this.config, required this.account, required this.accountId, }); factory AuthFactor.fromJson(Map json) => _$AuthFactorFromJson(json); Map toJson() => _$AuthFactorToJson(this); }