toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final timestamp = this.timestamp;
  final backendConnectionErrors = this.backendConnectionErrors;
  final segmentsReceivedCount = this.segmentsReceivedCount;
  final segmentsRejectedCount = this.segmentsRejectedCount;
  final segmentsSentCount = this.segmentsSentCount;
  final segmentsSpilloverCount = this.segmentsSpilloverCount;
  return {
    'Timestamp': unixTimestampToJson(timestamp),
    if (backendConnectionErrors != null)
      'BackendConnectionErrors': backendConnectionErrors,
    if (segmentsReceivedCount != null)
      'SegmentsReceivedCount': segmentsReceivedCount,
    if (segmentsRejectedCount != null)
      'SegmentsRejectedCount': segmentsRejectedCount,
    if (segmentsSentCount != null) 'SegmentsSentCount': segmentsSentCount,
    if (segmentsSpilloverCount != null)
      'SegmentsSpilloverCount': segmentsSpilloverCount,
  };
}