toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['keywordList'] = keywordList;
  data['keywordMatchType'] = keywordMatchType.index;
  data.putIfNotNull('conversationId', conversationId);
  if (msgTypes != null) {
    data['msgTypes'] = msgTypes!.map((e) => e.index).toList();
  }
  // startTime and endTime are sent only as a pair.
  if (startTime != null && endTime != null) {
    data['startTime'] = startTime;
    data['endTime'] = endTime;
  }
  data['searchScope'] = searchScope.index;
  return data;
}