mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: sync auth user (#20067)
This commit is contained in:
parent
ab597155fa
commit
92384c28de
20 changed files with 507 additions and 41 deletions
14
mobile/openapi/lib/model/sync_user_v1.dart
generated
14
mobile/openapi/lib/model/sync_user_v1.dart
generated
|
|
@ -13,12 +13,15 @@ part of openapi.api;
|
|||
class SyncUserV1 {
|
||||
/// Returns a new [SyncUserV1] instance.
|
||||
SyncUserV1({
|
||||
required this.avatarColor,
|
||||
required this.deletedAt,
|
||||
required this.email,
|
||||
required this.id,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
UserAvatarColor? avatarColor;
|
||||
|
||||
DateTime? deletedAt;
|
||||
|
||||
String email;
|
||||
|
|
@ -29,6 +32,7 @@ class SyncUserV1 {
|
|||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is SyncUserV1 &&
|
||||
other.avatarColor == avatarColor &&
|
||||
other.deletedAt == deletedAt &&
|
||||
other.email == email &&
|
||||
other.id == id &&
|
||||
|
|
@ -37,16 +41,22 @@ class SyncUserV1 {
|
|||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(avatarColor == null ? 0 : avatarColor!.hashCode) +
|
||||
(deletedAt == null ? 0 : deletedAt!.hashCode) +
|
||||
(email.hashCode) +
|
||||
(id.hashCode) +
|
||||
(name.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'SyncUserV1[deletedAt=$deletedAt, email=$email, id=$id, name=$name]';
|
||||
String toString() => 'SyncUserV1[avatarColor=$avatarColor, deletedAt=$deletedAt, email=$email, id=$id, name=$name]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (this.avatarColor != null) {
|
||||
json[r'avatarColor'] = this.avatarColor;
|
||||
} else {
|
||||
// json[r'avatarColor'] = null;
|
||||
}
|
||||
if (this.deletedAt != null) {
|
||||
json[r'deletedAt'] = this.deletedAt!.toUtc().toIso8601String();
|
||||
} else {
|
||||
|
|
@ -67,6 +77,7 @@ class SyncUserV1 {
|
|||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return SyncUserV1(
|
||||
avatarColor: UserAvatarColor.fromJson(json[r'avatarColor']),
|
||||
deletedAt: mapDateTime(json, r'deletedAt', r''),
|
||||
email: mapValueOfType<String>(json, r'email')!,
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
|
|
@ -118,6 +129,7 @@ class SyncUserV1 {
|
|||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'avatarColor',
|
||||
'deletedAt',
|
||||
'email',
|
||||
'id',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue