toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final eventType = this.eventType;
  final sentAt = this.sentAt;
  final eventId = this.eventId;
  final eventValue = this.eventValue;
  final impression = this.impression;
  final itemId = this.itemId;
  final properties = this.properties;
  final recommendationId = this.recommendationId;
  return {
    'eventType': eventType,
    'sentAt': unixTimestampToJson(sentAt),
    if (eventId != null) 'eventId': eventId,
    if (eventValue != null) 'eventValue': eventValue,
    if (impression != null) 'impression': impression,
    if (itemId != null) 'itemId': itemId,
    if (properties != null) 'properties': jsonEncode(properties),
    if (recommendationId != null) 'recommendationId': recommendationId,
  };
}