toJson method
Converts a DeploymentStatus instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAvailableReplicas = availableReplicas;
final tempCollisionCount = collisionCount;
final tempConditions = conditions;
final tempObservedGeneration = observedGeneration;
final tempReadyReplicas = readyReplicas;
final tempReplicas = replicas;
final tempUnavailableReplicas = unavailableReplicas;
final tempUpdatedReplicas = updatedReplicas;
if (tempAvailableReplicas != null) {
jsonData['availableReplicas'] = tempAvailableReplicas;
}
if (tempCollisionCount != null) {
jsonData['collisionCount'] = tempCollisionCount;
}
if (tempConditions != null) {
jsonData['conditions'] =
tempConditions.map((e) => e.toJson()).toList(growable: false);
}
if (tempObservedGeneration != null) {
jsonData['observedGeneration'] = tempObservedGeneration;
}
if (tempReadyReplicas != null) {
jsonData['readyReplicas'] = tempReadyReplicas;
}
if (tempReplicas != null) {
jsonData['replicas'] = tempReplicas;
}
if (tempUnavailableReplicas != null) {
jsonData['unavailableReplicas'] = tempUnavailableReplicas;
}
if (tempUpdatedReplicas != null) {
jsonData['updatedReplicas'] = tempUpdatedReplicas;
}
return jsonData;
}