mix_push_message_entity.dart
2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
class MixPushMessageEntity {
final bool? arrivedMessage;
final String? content;
final String? description;
final MixPushMessageExtra? extra;
final String? messageId;
final int? messageType;
final bool? notified;
final int? notifyId;
final int? notifyType;
final int? passThrough;
final String? title;
MixPushMessageEntity({
this.arrivedMessage,
this.content,
this.description,
this.extra,
this.messageId,
this.messageType,
this.notified,
this.notifyId,
this.notifyType,
this.passThrough,
this.title,
});
factory MixPushMessageEntity.fromJson(Map<String, dynamic> json) {
return MixPushMessageEntity(
arrivedMessage: json['arrivedMessage'],
content: json['content'],
description: json['description'],
extra: json['extra'] == null
? null
: MixPushMessageExtra.fromJson(json['extra']),
messageId: json['messageId'],
messageType: json['messageType'],
notified: json['notified'],
notifyId: json['notifyId'],
notifyType: json['notifyType'],
passThrough: json['passThrough'],
title: json['title'],
);
}
Map<String, dynamic> toJson() => {
'arrivedMessage': arrivedMessage,
'content': content,
'description': description,
'extra': extra == null ? null : extra!.toJson(),
'messageId': messageId,
'messageType': messageType,
'notified': notified,
'notifyId': notifyId,
'notifyType': notifyType,
'passThrough': passThrough,
'title': title,
};
}
class MixPushMessageExtra {
final String? highPriorityEvent;
final String? feTs;
final String? planId;
final String? source;
final String? notifyForeground;
final String? mTs;
MixPushMessageExtra({
this.highPriorityEvent,
this.feTs,
this.planId,
this.source,
this.notifyForeground,
this.mTs,
});
factory MixPushMessageExtra.fromJson(Map<String, dynamic> json) {
return MixPushMessageExtra(
highPriorityEvent: json['high_priority_event'],
feTs: json['fe_ts'],
planId: json['__planId__'],
source: json['source'],
notifyForeground: json['notify_foreground'],
mTs: json['__m_ts'],
);
}
Map<String, dynamic> toJson() => {
'high_priority_event': highPriorityEvent,
'fe_ts': feTs,
'__planId__': planId,
'source': source,
'notify_foreground': notifyForeground,
'__m_ts': mTs,
};
}