toJson method
Converts a PersistentVolumeClaimStatus instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAccessModes = accessModes;
final tempAllocatedResources = allocatedResources;
final tempCapacity = capacity;
final tempConditions = conditions;
final tempPhase = phase;
final tempResizeStatus = resizeStatus;
if (tempAccessModes != null) {
jsonData['accessModes'] = tempAccessModes;
}
if (tempAllocatedResources != null) {
jsonData['allocatedResources'] = tempAllocatedResources;
}
if (tempCapacity != null) {
jsonData['capacity'] = tempCapacity;
}
if (tempConditions != null) {
jsonData['conditions'] =
tempConditions.map((e) => e.toJson()).toList(growable: false);
}
if (tempPhase != null) {
jsonData['phase'] = tempPhase;
}
if (tempResizeStatus != null) {
jsonData['resizeStatus'] = tempResizeStatus;
}
return jsonData;
}