You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.8 KiB
Dart

// ignore_for_file: invalid_annotation_target
import 'package:freezed_annotation/freezed_annotation.dart';
part 'userinfo.freezed.dart';
part 'userinfo.g.dart';
@Freezed(copyWith: false)
class UserGroupMembership with _$UserGroupMembership {
factory UserGroupMembership({
required String group,
required String expiry,
}) = _UserGroupMembership;
factory UserGroupMembership.fromJson(Map<String, dynamic> json) =>
_$UserGroupMembershipFromJson(json);
}
@Freezed(copyWith: false)
class UserAcceptLang with _$UserAcceptLang {
factory UserAcceptLang({
required double q,
@JsonKey(name: '*') required String langCode,
}) = _UserAcceptLang;
factory UserAcceptLang.fromJson(Map<String, dynamic> json) => _$UserAcceptLangFromJson(json);
}
@Freezed(copyWith: false)
class MetaUserInfo with _$MetaUserInfo {
factory MetaUserInfo({
required int id,
required String name,
List<String>? groups,
List<UserGroupMembership>? groupmemberships,
List<String>? implicitgroups,
List<String>? rights,
Map<String, List<String>>? changeablegroups,
Map<String, dynamic>? options,
int? editcount,
String? realname,
String? email,
DateTime? emailauthenticated,
DateTime? registrationdate,
List<UserAcceptLang>? acceptlang,
int? unreadcount,
Map<String, int>? centralids,
Map<String, String>? attachedlocal,
DateTime? latestcontrib,
}) = _MetaUserInfo;
factory MetaUserInfo.fromJson(Map<String, dynamic> json) => _$MetaUserInfoFromJson(json);
}
@Freezed(copyWith: false)
class MetaUserInfoResponse with _$MetaUserInfoResponse {
factory MetaUserInfoResponse({
required MetaUserInfo userinfo,
Map<int, String>? useravatar,
}) = _MetaUserInfoResponse;
factory MetaUserInfoResponse.fromJson(Map<String, dynamic> json) =>
_$MetaUserInfoResponseFromJson(json);
}