toJson method
Converts a HorizontalPodAutoscalerSpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempMaxReplicas = maxReplicas;
final tempMinReplicas = minReplicas;
final tempScaleTargetRef = scaleTargetRef;
final tempTargetCPUUtilizationPercentage = targetCPUUtilizationPercentage;
jsonData['maxReplicas'] = tempMaxReplicas;
if (tempMinReplicas != null) {
jsonData['minReplicas'] = tempMinReplicas;
}
jsonData['scaleTargetRef'] = tempScaleTargetRef.toJson();
if (tempTargetCPUUtilizationPercentage != null) {
jsonData['targetCPUUtilizationPercentage'] =
tempTargetCPUUtilizationPercentage;
}
return jsonData;
}