MessageRoutingEventData.fromJson constructor
MessageRoutingEventData.fromJson(
- JsonMap json
Decodes routed message data from JSON.
Implementation
factory fromJson(JsonMap json) => MessageRoutingEventData(
id: json['id'] as String? ?? '',
from: json['from'] as String? ?? '',
replyTo: json['reply_to'] as String? ?? '',
to: json['to'] as String? ?? '',
subject: json['subject'] as String? ?? '',
messageId: json['message_id'] as String? ?? '',
size: decodeIntOrNull(json['size']) ?? 0,
spamScore: decodeDoubleOrNull(json['spam_score']) ?? 0,
bounce: json['bounce'] as bool? ?? false,
cc: json['cc'] as String? ?? '',
date: json['date'] as String? ?? '',
inReplyTo: json['in_reply_to'] as String? ?? '',
references: json['references'] as String? ?? '',
autoSubmitted: json['auto_submitted'] as String? ?? '',
htmlBody: json['html_body'] as String? ?? '',
plainBody: json['plain_body'] as String? ?? '',
replyFromPlainBody: json['reply_from_plain_body'] as String? ?? '',
attachments: decodeList(
json['attachments'],
MessageRoutingAttachment.fromJson,
),
headers: decodeStringMapOrNull(json['headers']),
raw: json,
);