2020-02-15 07:48:41 +00:00
|
|
|
class ToDeviceEvent {
|
|
|
|
String sender;
|
|
|
|
String type;
|
|
|
|
Map<String, dynamic> content;
|
|
|
|
|
|
|
|
ToDeviceEvent({this.sender, this.type, this.content});
|
|
|
|
|
|
|
|
ToDeviceEvent.fromJson(Map<String, dynamic> json) {
|
|
|
|
sender = json['sender'];
|
|
|
|
type = json['type'];
|
|
|
|
content = json['content'] != null
|
|
|
|
? Map<String, dynamic>.from(json['content'])
|
|
|
|
: null;
|
|
|
|
}
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() {
|
2020-03-30 09:08:38 +00:00
|
|
|
var map = <String, dynamic>{};
|
|
|
|
final data = map;
|
|
|
|
data['sender'] = sender;
|
|
|
|
data['type'] = type;
|
|
|
|
if (content != null) {
|
|
|
|
data['content'] = content;
|
2020-02-15 07:48:41 +00:00
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
}
|
2020-05-22 13:51:45 +00:00
|
|
|
|
|
|
|
class ToDeviceEventDecryptionError extends ToDeviceEvent {
|
|
|
|
Exception exception;
|
|
|
|
StackTrace stackTrace;
|
|
|
|
ToDeviceEventDecryptionError({
|
|
|
|
ToDeviceEvent toDeviceEvent,
|
|
|
|
this.exception,
|
|
|
|
this.stackTrace,
|
|
|
|
}) : super(
|
|
|
|
sender: toDeviceEvent.sender,
|
|
|
|
content: toDeviceEvent.content,
|
|
|
|
type: toDeviceEvent.type,
|
|
|
|
);
|
|
|
|
}
|