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.

102 lines
2.2 KiB
Dart

import 'package:json_annotation/json_annotation.dart';
part 'userinfo.g.dart';
@JsonSerializable()
class UserGroupMembership {
String group;
String expiry;
UserGroupMembership({
required this.group,
required this.expiry,
});
factory UserGroupMembership.fromJson(Map<String, dynamic> json) =>
_$UserGroupMembershipFromJson(json);
Map<String, dynamic> toJson() => _$UserGroupMembershipToJson(this);
}
@JsonSerializable()
class UserAcceptLang {
double q;
@JsonKey(name: '*')
String langCode;
UserAcceptLang({
required this.q,
required this.langCode,
});
factory UserAcceptLang.fromJson(Map<String, dynamic> json) =>
_$UserAcceptLangFromJson(json);
Map<String, dynamic> toJson() => _$UserAcceptLangToJson(this);
}
@JsonSerializable()
class MetaUserInfo {
int id;
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({
required this.id,
required this.name,
this.groups,
this.groupmemberships,
this.implicitgroups,
this.rights,
this.changeablegroups,
this.options,
this.editcount,
this.realname,
this.email,
this.emailauthenticated,
this.registrationdate,
this.acceptlang,
this.unreadcount,
this.centralids,
this.attachedlocal,
this.latestcontrib,
});
factory MetaUserInfo.fromJson(Map<String, dynamic> json) =>
_$MetaUserInfoFromJson(json);
Map<String, dynamic> toJson() => _$MetaUserInfoToJson(this);
}
@JsonSerializable()
class MetaUserInfoResponse {
MetaUserInfo userinfo;
Map<int, String>? useravatar;
MetaUserInfoResponse({
required this.userinfo,
this.useravatar,
});
factory MetaUserInfoResponse.fromJson(Map<String, dynamic> json) =>
_$MetaUserInfoResponseFromJson(json);
Map<String, dynamic> toJson() => _$MetaUserInfoResponseToJson(this);
}