PersistentVolumeClaimSpec.fromJson constructor
Creates a PersistentVolumeClaimSpec from JSON data.
Implementation
factory PersistentVolumeClaimSpec.fromJson(Map<String, dynamic> json) {
final tempAccessModesJson = json['accessModes'];
final tempDataSourceJson = json['dataSource'];
final tempDataSourceRefJson = json['dataSourceRef'];
final tempResourcesJson = json['resources'];
final tempSelectorJson = json['selector'];
final tempStorageClassNameJson = json['storageClassName'];
final tempVolumeModeJson = json['volumeMode'];
final tempVolumeNameJson = json['volumeName'];
final List<String>? tempAccessModes = tempAccessModesJson != null
? List<String>.from(tempAccessModesJson)
: null;
final TypedLocalObjectReference? tempDataSource = tempDataSourceJson != null
? TypedLocalObjectReference.fromJson(tempDataSourceJson)
: null;
final TypedObjectReference? tempDataSourceRef =
tempDataSourceRefJson != null
? TypedObjectReference.fromJson(tempDataSourceRefJson)
: null;
final ResourceRequirements? tempResources = tempResourcesJson != null
? ResourceRequirements.fromJson(tempResourcesJson)
: null;
final LabelSelector? tempSelector = tempSelectorJson != null
? LabelSelector.fromJson(tempSelectorJson)
: null;
final String? tempStorageClassName = tempStorageClassNameJson;
final String? tempVolumeMode = tempVolumeModeJson;
final String? tempVolumeName = tempVolumeNameJson;
return PersistentVolumeClaimSpec(
accessModes: tempAccessModes,
dataSource: tempDataSource,
dataSourceRef: tempDataSourceRef,
resources: tempResources,
selector: tempSelector,
storageClassName: tempStorageClassName,
volumeMode: tempVolumeMode,
volumeName: tempVolumeName,
);
}