toJson method
Converts a CSIDriverSpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAttachRequired = attachRequired;
final tempFsGroupPolicy = fsGroupPolicy;
final tempPodInfoOnMount = podInfoOnMount;
final tempRequiresRepublish = requiresRepublish;
final tempSeLinuxMount = seLinuxMount;
final tempStorageCapacity = storageCapacity;
final tempTokenRequests = tokenRequests;
final tempVolumeLifecycleModes = volumeLifecycleModes;
if (tempAttachRequired != null) {
jsonData['attachRequired'] = tempAttachRequired;
}
if (tempFsGroupPolicy != null) {
jsonData['fsGroupPolicy'] = tempFsGroupPolicy;
}
if (tempPodInfoOnMount != null) {
jsonData['podInfoOnMount'] = tempPodInfoOnMount;
}
if (tempRequiresRepublish != null) {
jsonData['requiresRepublish'] = tempRequiresRepublish;
}
if (tempSeLinuxMount != null) {
jsonData['seLinuxMount'] = tempSeLinuxMount;
}
if (tempStorageCapacity != null) {
jsonData['storageCapacity'] = tempStorageCapacity;
}
if (tempTokenRequests != null) {
jsonData['tokenRequests'] =
tempTokenRequests.map((e) => e.toJson()).toList(growable: false);
}
if (tempVolumeLifecycleModes != null) {
jsonData['volumeLifecycleModes'] = tempVolumeLifecycleModes;
}
return jsonData;
}