toJson method
Converts a PersistentVolumeSpec instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempAccessModes = accessModes;
final tempAwsElasticBlockStore = awsElasticBlockStore;
final tempAzureDisk = azureDisk;
final tempAzureFile = azureFile;
final tempCapacity = capacity;
final tempCephfs = cephfs;
final tempCinder = cinder;
final tempClaimRef = claimRef;
final tempCsi = csi;
final tempFc = fc;
final tempFlexVolume = flexVolume;
final tempFlocker = flocker;
final tempGcePersistentDisk = gcePersistentDisk;
final tempGlusterfs = glusterfs;
final tempHostPath = hostPath;
final tempIscsi = iscsi;
final tempLocal = local;
final tempMountOptions = mountOptions;
final tempNfs = nfs;
final tempNodeAffinity = nodeAffinity;
final tempPersistentVolumeReclaimPolicy = persistentVolumeReclaimPolicy;
final tempPhotonPersistentDisk = photonPersistentDisk;
final tempPortworxVolume = portworxVolume;
final tempQuobyte = quobyte;
final tempRbd = rbd;
final tempScaleIO = scaleIO;
final tempStorageClassName = storageClassName;
final tempStorageos = storageos;
final tempVolumeMode = volumeMode;
final tempVsphereVolume = vsphereVolume;
if (tempAccessModes != null) {
jsonData['accessModes'] = tempAccessModes;
}
if (tempAwsElasticBlockStore != null) {
jsonData['awsElasticBlockStore'] = tempAwsElasticBlockStore.toJson();
}
if (tempAzureDisk != null) {
jsonData['azureDisk'] = tempAzureDisk.toJson();
}
if (tempAzureFile != null) {
jsonData['azureFile'] = tempAzureFile.toJson();
}
if (tempCapacity != null) {
jsonData['capacity'] = tempCapacity;
}
if (tempCephfs != null) {
jsonData['cephfs'] = tempCephfs.toJson();
}
if (tempCinder != null) {
jsonData['cinder'] = tempCinder.toJson();
}
if (tempClaimRef != null) {
jsonData['claimRef'] = tempClaimRef.toJson();
}
if (tempCsi != null) {
jsonData['csi'] = tempCsi.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 (tempGlusterfs != null) {
jsonData['glusterfs'] = tempGlusterfs.toJson();
}
if (tempHostPath != null) {
jsonData['hostPath'] = tempHostPath.toJson();
}
if (tempIscsi != null) {
jsonData['iscsi'] = tempIscsi.toJson();
}
if (tempLocal != null) {
jsonData['local'] = tempLocal.toJson();
}
if (tempMountOptions != null) {
jsonData['mountOptions'] = tempMountOptions;
}
if (tempNfs != null) {
jsonData['nfs'] = tempNfs.toJson();
}
if (tempNodeAffinity != null) {
jsonData['nodeAffinity'] = tempNodeAffinity.toJson();
}
if (tempPersistentVolumeReclaimPolicy != null) {
jsonData['persistentVolumeReclaimPolicy'] =
tempPersistentVolumeReclaimPolicy;
}
if (tempPhotonPersistentDisk != null) {
jsonData['photonPersistentDisk'] = tempPhotonPersistentDisk.toJson();
}
if (tempPortworxVolume != null) {
jsonData['portworxVolume'] = tempPortworxVolume.toJson();
}
if (tempQuobyte != null) {
jsonData['quobyte'] = tempQuobyte.toJson();
}
if (tempRbd != null) {
jsonData['rbd'] = tempRbd.toJson();
}
if (tempScaleIO != null) {
jsonData['scaleIO'] = tempScaleIO.toJson();
}
if (tempStorageClassName != null) {
jsonData['storageClassName'] = tempStorageClassName;
}
if (tempStorageos != null) {
jsonData['storageos'] = tempStorageos.toJson();
}
if (tempVolumeMode != null) {
jsonData['volumeMode'] = tempVolumeMode;
}
if (tempVsphereVolume != null) {
jsonData['vsphereVolume'] = tempVsphereVolume.toJson();
}
return jsonData;
}