toJson method
Converts a CSIVolumeSource instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempDriver = driver;
final tempFsType = fsType;
final tempNodePublishSecretRef = nodePublishSecretRef;
final tempReadOnly = readOnly;
final tempVolumeAttributes = volumeAttributes;
jsonData['driver'] = tempDriver;
if (tempFsType != null) {
jsonData['fsType'] = tempFsType;
}
if (tempNodePublishSecretRef != null) {
jsonData['nodePublishSecretRef'] = tempNodePublishSecretRef.toJson();
}
if (tempReadOnly != null) {
jsonData['readOnly'] = tempReadOnly;
}
if (tempVolumeAttributes != null) {
jsonData['volumeAttributes'] = tempVolumeAttributes;
}
return jsonData;
}