fromJson static method

TencentCloudChatRobotData fromJson(
  1. Map<String, dynamic> jsonData
)

Implementation

static TencentCloudChatRobotData fromJson(Map<String, dynamic> jsonData) {
  int chatbotPlugin = jsonData["chatbotPlugin"] ?? 0;
  List<String> chunks = List<String>.from(jsonData["chunks"] ?? []);
  TencentCloudChatRobotSrcEnum src = converIntToEnum(jsonData["src"] ?? 0);
  String subtype = jsonData["subtype"] ?? "";
  String robotID = jsonData["robotID"] ?? "";
  int isFinished = jsonData["isFinished"] ?? 2; // 0 未结束 1 已结束 2 旧消息没有这个字段
  String msgID = jsonData["msgID"] ?? "";
  TencentCloudChatRobotModelContent content =
      TencentCloudChatRobotModelContent.fromJson(jsonData["content"] ?? {});
  return TencentCloudChatRobotData(chatbotPlugin, chunks, src, content,
      subtype, robotID, isFinished, msgID);
}