toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final comparisonOperator = this.comparisonOperator;
  final consecutiveDatapointsToAlarm = this.consecutiveDatapointsToAlarm;
  final consecutiveDatapointsToClear = this.consecutiveDatapointsToClear;
  final durationSeconds = this.durationSeconds;
  final mlDetectionConfig = this.mlDetectionConfig;
  final statisticalThreshold = this.statisticalThreshold;
  final value = this.value;
  return {
    if (comparisonOperator != null)
      'comparisonOperator': comparisonOperator.toValue(),
    if (consecutiveDatapointsToAlarm != null)
      'consecutiveDatapointsToAlarm': consecutiveDatapointsToAlarm,
    if (consecutiveDatapointsToClear != null)
      'consecutiveDatapointsToClear': consecutiveDatapointsToClear,
    if (durationSeconds != null) 'durationSeconds': durationSeconds,
    if (mlDetectionConfig != null) 'mlDetectionConfig': mlDetectionConfig,
    if (statisticalThreshold != null)
      'statisticalThreshold': statisticalThreshold,
    if (value != null) 'value': value,
  };
}