PersistentVolumeClaimStatus.fromJson constructor
Creates a PersistentVolumeClaimStatus from JSON data.
Implementation
factory PersistentVolumeClaimStatus.fromJson(Map<String, dynamic> json) {
final tempAccessModesJson = json['accessModes'];
final tempAllocatedResourcesJson = json['allocatedResources'];
final tempCapacityJson = json['capacity'];
final tempConditionsJson = json['conditions'];
final tempPhaseJson = json['phase'];
final tempResizeStatusJson = json['resizeStatus'];
final List<String>? tempAccessModes = tempAccessModesJson != null
? List<String>.from(tempAccessModesJson)
: null;
final Map<String, String>? tempAllocatedResources =
tempAllocatedResourcesJson != null
? Map<String, String>.from(tempAllocatedResourcesJson)
: null;
final Map<String, String>? tempCapacity = tempCapacityJson != null
? Map<String, String>.from(tempCapacityJson)
: null;
final List<PersistentVolumeClaimCondition>? tempConditions =
tempConditionsJson != null
? List<dynamic>.from(tempConditionsJson)
.map(
(e) => PersistentVolumeClaimCondition.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final String? tempPhase = tempPhaseJson;
final String? tempResizeStatus = tempResizeStatusJson;
return PersistentVolumeClaimStatus(
accessModes: tempAccessModes,
allocatedResources: tempAllocatedResources,
capacity: tempCapacity,
conditions: tempConditions,
phase: tempPhase,
resizeStatus: tempResizeStatus,
);
}