toJson method
Converts a ISCSIVolumeSource instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempChapAuthDiscovery = chapAuthDiscovery;
final tempChapAuthSession = chapAuthSession;
final tempFsType = fsType;
final tempInitiatorName = initiatorName;
final tempIqn = iqn;
final tempIscsiInterface = iscsiInterface;
final tempLun = lun;
final tempPortals = portals;
final tempReadOnly = readOnly;
final tempSecretRef = secretRef;
final tempTargetPortal = targetPortal;
if (tempChapAuthDiscovery != null) {
jsonData['chapAuthDiscovery'] = tempChapAuthDiscovery;
}
if (tempChapAuthSession != null) {
jsonData['chapAuthSession'] = tempChapAuthSession;
}
if (tempFsType != null) {
jsonData['fsType'] = tempFsType;
}
if (tempInitiatorName != null) {
jsonData['initiatorName'] = tempInitiatorName;
}
jsonData['iqn'] = tempIqn;
if (tempIscsiInterface != null) {
jsonData['iscsiInterface'] = tempIscsiInterface;
}
jsonData['lun'] = tempLun;
if (tempPortals != null) {
jsonData['portals'] = tempPortals;
}
if (tempReadOnly != null) {
jsonData['readOnly'] = tempReadOnly;
}
if (tempSecretRef != null) {
jsonData['secretRef'] = tempSecretRef.toJson();
}
jsonData['targetPortal'] = tempTargetPortal;
return jsonData;
}