jld3103
2 years ago
31 changed files with 182 additions and 280 deletions
@ -1,32 +0,0 @@ |
|||||||
import 'package:json_annotation/json_annotation.dart'; |
|
||||||
import 'package:nextcloud/nextcloud.dart'; |
|
||||||
|
|
||||||
part 'nextcloud_notification.g.dart'; |
|
||||||
|
|
||||||
@JsonSerializable() |
|
||||||
class NextcloudNotification { |
|
||||||
NextcloudNotification({ |
|
||||||
required this.accountID, |
|
||||||
required this.priority, |
|
||||||
required this.type, |
|
||||||
required this.subject, |
|
||||||
}); |
|
||||||
|
|
||||||
factory NextcloudNotification.fromJson(final Map<String, dynamic> json) => _$NextcloudNotificationFromJson(json); |
|
||||||
Map<String, dynamic> toJson() => _$NextcloudNotificationToJson(this); |
|
||||||
|
|
||||||
final String accountID; |
|
||||||
final String priority; |
|
||||||
final String type; |
|
||||||
|
|
||||||
@JsonKey( |
|
||||||
fromJson: _fromJsonSubject, |
|
||||||
toJson: _toJsonSubject, |
|
||||||
) |
|
||||||
final NotificationsPushNotificationDecryptedSubject subject; |
|
||||||
} |
|
||||||
|
|
||||||
NotificationsPushNotificationDecryptedSubject _fromJsonSubject(final Map<String, dynamic> data) => |
|
||||||
NotificationsPushNotificationDecryptedSubject.fromJson(data)!; |
|
||||||
|
|
||||||
Map<String, dynamic>? _toJsonSubject(final NotificationsPushNotificationDecryptedSubject subject) => subject.toJson(); |
|
@ -1,21 +0,0 @@ |
|||||||
// GENERATED CODE - DO NOT MODIFY BY HAND |
|
||||||
|
|
||||||
part of 'nextcloud_notification.dart'; |
|
||||||
|
|
||||||
// ************************************************************************** |
|
||||||
// JsonSerializableGenerator |
|
||||||
// ************************************************************************** |
|
||||||
|
|
||||||
NextcloudNotification _$NextcloudNotificationFromJson(Map<String, dynamic> json) => NextcloudNotification( |
|
||||||
accountID: json['accountID'] as String, |
|
||||||
priority: json['priority'] as String, |
|
||||||
type: json['type'] as String, |
|
||||||
subject: _fromJsonSubject(json['subject'] as Map<String, dynamic>), |
|
||||||
); |
|
||||||
|
|
||||||
Map<String, dynamic> _$NextcloudNotificationToJson(NextcloudNotification instance) => <String, dynamic>{ |
|
||||||
'accountID': instance.accountID, |
|
||||||
'priority': instance.priority, |
|
||||||
'type': instance.type, |
|
||||||
'subject': _toJsonSubject(instance.subject), |
|
||||||
}; |
|
Loading…
Reference in new issue