toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final eventContext = this.eventContext;
  final filter = this.filter;
  final groupings = this.groupings;
  final includeState = this.includeState;
  final keys = this.keys;
  final orderBy = this.orderBy;
  return {
    if (eventContext != null) 'event_context': eventContext.toJson(),
    if (filter != null) 'filter': filter.toJson(),
    if (groupings != null) 'groupings': groupings.toJson(),
    if (includeState != null) 'include_state': includeState,
    if (keys != null) 'keys': keys.map((v) => v.name).toList(),
    if (orderBy != null) 'order_by': orderBy.name,
    'search_term': searchTerm,
  };
}