toJson method

Map<String, Object> toJson()

Converts a MetricValueStatus instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempAverageUtilization = averageUtilization;
  final tempAverageValue = averageValue;
  final tempValue = value;

  if (tempAverageUtilization != null) {
    jsonData['averageUtilization'] = tempAverageUtilization;
  }

  if (tempAverageValue != null) {
    jsonData['averageValue'] = tempAverageValue;
  }

  if (tempValue != null) {
    jsonData['value'] = tempValue;
  }

  return jsonData;
}