toJson method
Converts a Volume instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAwsElasticBlockStore = awsElasticBlockStore;
final tempAzureDisk = azureDisk;
final tempAzureFile = azureFile;
final tempCephfs = cephfs;
final tempCinder = cinder;
final tempConfigMap = configMap;
final tempCsi = csi;
final tempDownwardAPI = downwardAPI;
final tempEmptyDir = emptyDir;
final tempEphemeral = ephemeral;
final tempFc = fc;
final tempFlexVolume = flexVolume;
final tempFlocker = flocker;
final tempGcePersistentDisk = gcePersistentDisk;
final tempGitRepo = gitRepo;
final tempGlusterfs = glusterfs;
final tempHostPath = hostPath;
final tempIscsi = iscsi;
final tempName = name;
final tempNfs = nfs;
final tempPersistentVolumeClaim = persistentVolumeClaim;
final tempPhotonPersistentDisk = photonPersistentDisk;
final tempPortworxVolume = portworxVolume;
final tempProjected = projected;
final tempQuobyte = quobyte;
final tempRbd = rbd;
final tempScaleIO = scaleIO;
final tempSecret = secret;
final tempStorageos = storageos;
final tempVsphereVolume = vsphereVolume;
if (tempAwsElasticBlockStore != null) {
jsonData['awsElasticBlockStore'] = tempAwsElasticBlockStore.toJson();
}
if (tempAzureDisk != null) {
jsonData['azureDisk'] = tempAzureDisk.toJson();
}
if (tempAzureFile != null) {
jsonData['azureFile'] = tempAzureFile.toJson();
}
if (tempCephfs != null) {
jsonData['cephfs'] = tempCephfs.toJson();
}
if (tempCinder != null) {
jsonData['cinder'] = tempCinder.toJson();
}
if (tempConfigMap != null) {
jsonData['configMap'] = tempConfigMap.toJson();
}
if (tempCsi != null) {
jsonData['csi'] = tempCsi.toJson();
}
if (tempDownwardAPI != null) {
jsonData['downwardAPI'] = tempDownwardAPI.toJson();
}
if (tempEmptyDir != null) {
jsonData['emptyDir'] = tempEmptyDir.toJson();
}
if (tempEphemeral != null) {
jsonData['ephemeral'] = tempEphemeral.toJson();
}
if (tempFc != null) {
jsonData['fc'] = tempFc.toJson();
}
if (tempFlexVolume != null) {
jsonData['flexVolume'] = tempFlexVolume.toJson();
}
if (tempFlocker != null) {
jsonData['flocker'] = tempFlocker.toJson();
}
if (tempGcePersistentDisk != null) {
jsonData['gcePersistentDisk'] = tempGcePersistentDisk.toJson();
}
if (tempGitRepo != null) {
jsonData['gitRepo'] = tempGitRepo.toJson();
}
if (tempGlusterfs != null) {
jsonData['glusterfs'] = tempGlusterfs.toJson();
}
if (tempHostPath != null) {
jsonData['hostPath'] = tempHostPath.toJson();
}
if (tempIscsi != null) {
jsonData['iscsi'] = tempIscsi.toJson();
}
jsonData['name'] = tempName;
if (tempNfs != null) {
jsonData['nfs'] = tempNfs.toJson();
}
if (tempPersistentVolumeClaim != null) {
jsonData['persistentVolumeClaim'] = tempPersistentVolumeClaim.toJson();
}
if (tempPhotonPersistentDisk != null) {
jsonData['photonPersistentDisk'] = tempPhotonPersistentDisk.toJson();
}
if (tempPortworxVolume != null) {
jsonData['portworxVolume'] = tempPortworxVolume.toJson();
}
if (tempProjected != null) {
jsonData['projected'] = tempProjected.toJson();
}
if (tempQuobyte != null) {
jsonData['quobyte'] = tempQuobyte.toJson();
}
if (tempRbd != null) {
jsonData['rbd'] = tempRbd.toJson();
}
if (tempScaleIO != null) {
jsonData['scaleIO'] = tempScaleIO.toJson();
}
if (tempSecret != null) {
jsonData['secret'] = tempSecret.toJson();
}
if (tempStorageos != null) {
jsonData['storageos'] = tempStorageos.toJson();
}
if (tempVsphereVolume != null) {
jsonData['vsphereVolume'] = tempVsphereVolume.toJson();
}
return jsonData;
}