ChannelMessageSummary.fromJson constructor

ChannelMessageSummary.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ChannelMessageSummary.fromJson(Map<String, dynamic> json) {
  return ChannelMessageSummary(
    content: json['Content'] as String?,
    createdTimestamp: timeStampFromJson(json['CreatedTimestamp']),
    lastEditedTimestamp: timeStampFromJson(json['LastEditedTimestamp']),
    lastUpdatedTimestamp: timeStampFromJson(json['LastUpdatedTimestamp']),
    messageId: json['MessageId'] as String?,
    metadata: json['Metadata'] as String?,
    redacted: json['Redacted'] as bool?,
    sender: json['Sender'] != null
        ? Identity.fromJson(json['Sender'] as Map<String, dynamic>)
        : null,
    type: (json['Type'] as String?)?.toChannelMessageType(),
  );
}