toJson method
Converts a PodDisruptionBudgetStatus instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempConditions = conditions;
final tempCurrentHealthy = currentHealthy;
final tempDesiredHealthy = desiredHealthy;
final tempDisruptedPods = disruptedPods;
final tempDisruptionsAllowed = disruptionsAllowed;
final tempExpectedPods = expectedPods;
final tempObservedGeneration = observedGeneration;
if (tempConditions != null) {
jsonData['conditions'] =
tempConditions.map((e) => e.toJson()).toList(growable: false);
}
jsonData['currentHealthy'] = tempCurrentHealthy;
jsonData['desiredHealthy'] = tempDesiredHealthy;
if (tempDisruptedPods != null) {
jsonData['disruptedPods'] = tempDisruptedPods;
}
jsonData['disruptionsAllowed'] = tempDisruptionsAllowed;
jsonData['expectedPods'] = tempExpectedPods;
if (tempObservedGeneration != null) {
jsonData['observedGeneration'] = tempObservedGeneration;
}
return jsonData;
}