feat: user preferences for archive download size (#10296)

* feat: user preferences for archive download size

* chore: open api

* chore: clean up

---------

Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
Daniel Dietzler
2024-06-14 17:27:12 +02:00
committed by GitHub
parent 596412cb8f
commit dddc06c3b2
19 changed files with 442 additions and 24 deletions

View File

@@ -14,12 +14,15 @@ class UserPreferencesResponseDto {
/// Returns a new [UserPreferencesResponseDto] instance.
UserPreferencesResponseDto({
required this.avatar,
required this.download,
required this.emailNotifications,
required this.memories,
});
AvatarResponse avatar;
DownloadResponse download;
EmailNotificationsResponse emailNotifications;
MemoryResponse memories;
@@ -27,6 +30,7 @@ class UserPreferencesResponseDto {
@override
bool operator ==(Object other) => identical(this, other) || other is UserPreferencesResponseDto &&
other.avatar == avatar &&
other.download == download &&
other.emailNotifications == emailNotifications &&
other.memories == memories;
@@ -34,15 +38,17 @@ class UserPreferencesResponseDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(avatar.hashCode) +
(download.hashCode) +
(emailNotifications.hashCode) +
(memories.hashCode);
@override
String toString() => 'UserPreferencesResponseDto[avatar=$avatar, emailNotifications=$emailNotifications, memories=$memories]';
String toString() => 'UserPreferencesResponseDto[avatar=$avatar, download=$download, emailNotifications=$emailNotifications, memories=$memories]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'avatar'] = this.avatar;
json[r'download'] = this.download;
json[r'emailNotifications'] = this.emailNotifications;
json[r'memories'] = this.memories;
return json;
@@ -57,6 +63,7 @@ class UserPreferencesResponseDto {
return UserPreferencesResponseDto(
avatar: AvatarResponse.fromJson(json[r'avatar'])!,
download: DownloadResponse.fromJson(json[r'download'])!,
emailNotifications: EmailNotificationsResponse.fromJson(json[r'emailNotifications'])!,
memories: MemoryResponse.fromJson(json[r'memories'])!,
);
@@ -107,6 +114,7 @@ class UserPreferencesResponseDto {
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'avatar',
'download',
'emailNotifications',
'memories',
};