toJson method
Converts a PersistentVolumeClaimSpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAccessModes = accessModes;
final tempDataSource = dataSource;
final tempDataSourceRef = dataSourceRef;
final tempResources = resources;
final tempSelector = selector;
final tempStorageClassName = storageClassName;
final tempVolumeMode = volumeMode;
final tempVolumeName = volumeName;
if (tempAccessModes != null) {
jsonData['accessModes'] = tempAccessModes;
}
if (tempDataSource != null) {
jsonData['dataSource'] = tempDataSource.toJson();
}
if (tempDataSourceRef != null) {
jsonData['dataSourceRef'] = tempDataSourceRef.toJson();
}
if (tempResources != null) {
jsonData['resources'] = tempResources.toJson();
}
if (tempSelector != null) {
jsonData['selector'] = tempSelector.toJson();
}
if (tempStorageClassName != null) {
jsonData['storageClassName'] = tempStorageClassName;
}
if (tempVolumeMode != null) {
jsonData['volumeMode'] = tempVolumeMode;
}
if (tempVolumeName != null) {
jsonData['volumeName'] = tempVolumeName;
}
return jsonData;
}