Skip to content

Commit

Permalink
Merge pull request #68 from poppingmoon/notification-export-follow-login
Browse files Browse the repository at this point in the history
Misskey 2024.10.0で追加される通知に対応
  • Loading branch information
shiosyakeyakini-info authored Oct 14, 2024
2 parents 7355fe1 + 81b956d commit bb9e18d
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 24 deletions.
2 changes: 2 additions & 0 deletions lib/src/data/i/i_notifications_request.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions lib/src/data/i/i_notifications_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,23 @@ class INotificationsResponse with _$INotificationsResponse {
UserLite? user,
Note? note,
RolesListResponse? role,
UserExportableEntities? exportedEntity,
String? fileId,
String? message,
}) = _INotificationsResponse;

factory INotificationsResponse.fromJson(Map<String, Object?> json) =>
_$INotificationsResponseFromJson(json);
}

enum UserExportableEntities {
note,
antenna,
blocking,
clip,
customEmoji,
favorite,
following,
muting,
userList
}
114 changes: 90 additions & 24 deletions lib/src/data/i/i_notifications_response.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ mixin _$INotificationsResponse {
UserLite? get user => throw _privateConstructorUsedError;
Note? get note => throw _privateConstructorUsedError;
RolesListResponse? get role => throw _privateConstructorUsedError;
UserExportableEntities? get exportedEntity =>
throw _privateConstructorUsedError;
String? get fileId => throw _privateConstructorUsedError;
String? get message => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand Down Expand Up @@ -68,7 +72,10 @@ abstract class $INotificationsResponseCopyWith<$Res> {
String? userId,
UserLite? user,
Note? note,
RolesListResponse? role});
RolesListResponse? role,
UserExportableEntities? exportedEntity,
String? fileId,
String? message});

$UserLiteCopyWith<$Res>? get user;
$NoteCopyWith<$Res>? get note;
Expand Down Expand Up @@ -105,6 +112,9 @@ class _$INotificationsResponseCopyWithImpl<$Res,
Object? user = freezed,
Object? note = freezed,
Object? role = freezed,
Object? exportedEntity = freezed,
Object? fileId = freezed,
Object? message = freezed,
}) {
return _then(_value.copyWith(
id: null == id
Expand Down Expand Up @@ -171,6 +181,18 @@ class _$INotificationsResponseCopyWithImpl<$Res,
? _value.role
: role // ignore: cast_nullable_to_non_nullable
as RolesListResponse?,
exportedEntity: freezed == exportedEntity
? _value.exportedEntity
: exportedEntity // ignore: cast_nullable_to_non_nullable
as UserExportableEntities?,
fileId: freezed == fileId
? _value.fileId
: fileId // ignore: cast_nullable_to_non_nullable
as String?,
message: freezed == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String?,
) as $Val);
}

Expand Down Expand Up @@ -236,7 +258,10 @@ abstract class _$$INotificationsResponseImplCopyWith<$Res>
String? userId,
UserLite? user,
Note? note,
RolesListResponse? role});
RolesListResponse? role,
UserExportableEntities? exportedEntity,
String? fileId,
String? message});

@override
$UserLiteCopyWith<$Res>? get user;
Expand Down Expand Up @@ -275,6 +300,9 @@ class __$$INotificationsResponseImplCopyWithImpl<$Res>
Object? user = freezed,
Object? note = freezed,
Object? role = freezed,
Object? exportedEntity = freezed,
Object? fileId = freezed,
Object? message = freezed,
}) {
return _then(_$INotificationsResponseImpl(
id: null == id
Expand Down Expand Up @@ -341,6 +369,18 @@ class __$$INotificationsResponseImplCopyWithImpl<$Res>
? _value.role
: role // ignore: cast_nullable_to_non_nullable
as RolesListResponse?,
exportedEntity: freezed == exportedEntity
? _value.exportedEntity
: exportedEntity // ignore: cast_nullable_to_non_nullable
as UserExportableEntities?,
fileId: freezed == fileId
? _value.fileId
: fileId // ignore: cast_nullable_to_non_nullable
as String?,
message: freezed == message
? _value.message
: message // ignore: cast_nullable_to_non_nullable
as String?,
));
}
}
Expand All @@ -364,7 +404,10 @@ class _$INotificationsResponseImpl implements _INotificationsResponse {
this.userId,
this.user,
this.note,
this.role});
this.role,
this.exportedEntity,
this.fileId,
this.message});

factory _$INotificationsResponseImpl.fromJson(Map<String, dynamic> json) =>
_$$INotificationsResponseImplFromJson(json);
Expand Down Expand Up @@ -403,10 +446,16 @@ class _$INotificationsResponseImpl implements _INotificationsResponse {
final Note? note;
@override
final RolesListResponse? role;
@override
final UserExportableEntities? exportedEntity;
@override
final String? fileId;
@override
final String? message;

@override
String toString() {
return 'INotificationsResponse(id: $id, createdAt: $createdAt, type: $type, noteId: $noteId, followRequestId: $followRequestId, reaction: $reaction, choice: $choice, achievement: $achievement, body: $body, header: $header, icon: $icon, appAccessTokenId: $appAccessTokenId, userId: $userId, user: $user, note: $note, role: $role)';
return 'INotificationsResponse(id: $id, createdAt: $createdAt, type: $type, noteId: $noteId, followRequestId: $followRequestId, reaction: $reaction, choice: $choice, achievement: $achievement, body: $body, header: $header, icon: $icon, appAccessTokenId: $appAccessTokenId, userId: $userId, user: $user, note: $note, role: $role, exportedEntity: $exportedEntity, fileId: $fileId, message: $message)';
}

@override
Expand Down Expand Up @@ -434,29 +483,37 @@ class _$INotificationsResponseImpl implements _INotificationsResponse {
(identical(other.userId, userId) || other.userId == userId) &&
(identical(other.user, user) || other.user == user) &&
(identical(other.note, note) || other.note == note) &&
(identical(other.role, role) || other.role == role));
(identical(other.role, role) || other.role == role) &&
(identical(other.exportedEntity, exportedEntity) ||
other.exportedEntity == exportedEntity) &&
(identical(other.fileId, fileId) || other.fileId == fileId) &&
(identical(other.message, message) || other.message == message));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType,
id,
createdAt,
type,
noteId,
followRequestId,
reaction,
choice,
achievement,
body,
header,
icon,
appAccessTokenId,
userId,
user,
note,
role);
int get hashCode => Object.hashAll([
runtimeType,
id,
createdAt,
type,
noteId,
followRequestId,
reaction,
choice,
achievement,
body,
header,
icon,
appAccessTokenId,
userId,
user,
note,
role,
exportedEntity,
fileId,
message
]);

@JsonKey(ignore: true)
@override
Expand Down Expand Up @@ -490,7 +547,10 @@ abstract class _INotificationsResponse implements INotificationsResponse {
final String? userId,
final UserLite? user,
final Note? note,
final RolesListResponse? role}) = _$INotificationsResponseImpl;
final RolesListResponse? role,
final UserExportableEntities? exportedEntity,
final String? fileId,
final String? message}) = _$INotificationsResponseImpl;

factory _INotificationsResponse.fromJson(Map<String, dynamic> json) =
_$INotificationsResponseImpl.fromJson;
Expand Down Expand Up @@ -530,6 +590,12 @@ abstract class _INotificationsResponse implements INotificationsResponse {
@override
RolesListResponse? get role;
@override
UserExportableEntities? get exportedEntity;
@override
String? get fileId;
@override
String? get message;
@override
@JsonKey(ignore: true)
_$$INotificationsResponseImplCopyWith<_$INotificationsResponseImpl>
get copyWith => throw _privateConstructorUsedError;
Expand Down
22 changes: 22 additions & 0 deletions lib/src/data/i/i_notifications_response.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions lib/src/enums/notification_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ enum NotificationType {
@JsonValue("renote:grouped")
renoteGrouped,
roleAssigned,
exportCompleted,
login,
}

0 comments on commit bb9e18d

Please sign in to comment.