PersistentVolumeSpec.fromJson constructor

PersistentVolumeSpec.fromJson(
  1. Map<String, dynamic> json
)

Creates a PersistentVolumeSpec from JSON data.

Implementation

factory PersistentVolumeSpec.fromJson(Map<String, dynamic> json) {
  final tempAccessModesJson = json['accessModes'];
  final tempAwsElasticBlockStoreJson = json['awsElasticBlockStore'];
  final tempAzureDiskJson = json['azureDisk'];
  final tempAzureFileJson = json['azureFile'];
  final tempCapacityJson = json['capacity'];
  final tempCephfsJson = json['cephfs'];
  final tempCinderJson = json['cinder'];
  final tempClaimRefJson = json['claimRef'];
  final tempCsiJson = json['csi'];
  final tempFcJson = json['fc'];
  final tempFlexVolumeJson = json['flexVolume'];
  final tempFlockerJson = json['flocker'];
  final tempGcePersistentDiskJson = json['gcePersistentDisk'];
  final tempGlusterfsJson = json['glusterfs'];
  final tempHostPathJson = json['hostPath'];
  final tempIscsiJson = json['iscsi'];
  final tempLocalJson = json['local'];
  final tempMountOptionsJson = json['mountOptions'];
  final tempNfsJson = json['nfs'];
  final tempNodeAffinityJson = json['nodeAffinity'];
  final tempPersistentVolumeReclaimPolicyJson =
      json['persistentVolumeReclaimPolicy'];
  final tempPhotonPersistentDiskJson = json['photonPersistentDisk'];
  final tempPortworxVolumeJson = json['portworxVolume'];
  final tempQuobyteJson = json['quobyte'];
  final tempRbdJson = json['rbd'];
  final tempScaleIOJson = json['scaleIO'];
  final tempStorageClassNameJson = json['storageClassName'];
  final tempStorageosJson = json['storageos'];
  final tempVolumeModeJson = json['volumeMode'];
  final tempVsphereVolumeJson = json['vsphereVolume'];

  final List<String>? tempAccessModes = tempAccessModesJson != null
      ? List<String>.from(tempAccessModesJson)
      : null;
  final AWSElasticBlockStoreVolumeSource? tempAwsElasticBlockStore =
      tempAwsElasticBlockStoreJson != null
          ? AWSElasticBlockStoreVolumeSource.fromJson(
              tempAwsElasticBlockStoreJson)
          : null;
  final AzureDiskVolumeSource? tempAzureDisk = tempAzureDiskJson != null
      ? AzureDiskVolumeSource.fromJson(tempAzureDiskJson)
      : null;
  final AzureFilePersistentVolumeSource? tempAzureFile =
      tempAzureFileJson != null
          ? AzureFilePersistentVolumeSource.fromJson(tempAzureFileJson)
          : null;

  final Map<String, String>? tempCapacity = tempCapacityJson != null
      ? Map<String, String>.from(tempCapacityJson)
      : null;

  final CephFSPersistentVolumeSource? tempCephfs = tempCephfsJson != null
      ? CephFSPersistentVolumeSource.fromJson(tempCephfsJson)
      : null;
  final CinderPersistentVolumeSource? tempCinder = tempCinderJson != null
      ? CinderPersistentVolumeSource.fromJson(tempCinderJson)
      : null;
  final ObjectReference? tempClaimRef = tempClaimRefJson != null
      ? ObjectReference.fromJson(tempClaimRefJson)
      : null;
  final CSIPersistentVolumeSource? tempCsi = tempCsiJson != null
      ? CSIPersistentVolumeSource.fromJson(tempCsiJson)
      : null;
  final FCVolumeSource? tempFc =
      tempFcJson != null ? FCVolumeSource.fromJson(tempFcJson) : null;
  final FlexPersistentVolumeSource? tempFlexVolume =
      tempFlexVolumeJson != null
          ? FlexPersistentVolumeSource.fromJson(tempFlexVolumeJson)
          : null;
  final FlockerVolumeSource? tempFlocker = tempFlockerJson != null
      ? FlockerVolumeSource.fromJson(tempFlockerJson)
      : null;
  final GCEPersistentDiskVolumeSource? tempGcePersistentDisk =
      tempGcePersistentDiskJson != null
          ? GCEPersistentDiskVolumeSource.fromJson(tempGcePersistentDiskJson)
          : null;
  final GlusterfsPersistentVolumeSource? tempGlusterfs =
      tempGlusterfsJson != null
          ? GlusterfsPersistentVolumeSource.fromJson(tempGlusterfsJson)
          : null;
  final HostPathVolumeSource? tempHostPath = tempHostPathJson != null
      ? HostPathVolumeSource.fromJson(tempHostPathJson)
      : null;
  final ISCSIPersistentVolumeSource? tempIscsi = tempIscsiJson != null
      ? ISCSIPersistentVolumeSource.fromJson(tempIscsiJson)
      : null;
  final LocalVolumeSource? tempLocal = tempLocalJson != null
      ? LocalVolumeSource.fromJson(tempLocalJson)
      : null;
  final List<String>? tempMountOptions = tempMountOptionsJson != null
      ? List<String>.from(tempMountOptionsJson)
      : null;
  final NFSVolumeSource? tempNfs =
      tempNfsJson != null ? NFSVolumeSource.fromJson(tempNfsJson) : null;
  final VolumeNodeAffinity? tempNodeAffinity = tempNodeAffinityJson != null
      ? VolumeNodeAffinity.fromJson(tempNodeAffinityJson)
      : null;
  final String? tempPersistentVolumeReclaimPolicy =
      tempPersistentVolumeReclaimPolicyJson;
  final PhotonPersistentDiskVolumeSource? tempPhotonPersistentDisk =
      tempPhotonPersistentDiskJson != null
          ? PhotonPersistentDiskVolumeSource.fromJson(
              tempPhotonPersistentDiskJson)
          : null;
  final PortworxVolumeSource? tempPortworxVolume =
      tempPortworxVolumeJson != null
          ? PortworxVolumeSource.fromJson(tempPortworxVolumeJson)
          : null;
  final QuobyteVolumeSource? tempQuobyte = tempQuobyteJson != null
      ? QuobyteVolumeSource.fromJson(tempQuobyteJson)
      : null;
  final RBDPersistentVolumeSource? tempRbd = tempRbdJson != null
      ? RBDPersistentVolumeSource.fromJson(tempRbdJson)
      : null;
  final ScaleIOPersistentVolumeSource? tempScaleIO = tempScaleIOJson != null
      ? ScaleIOPersistentVolumeSource.fromJson(tempScaleIOJson)
      : null;
  final String? tempStorageClassName = tempStorageClassNameJson;
  final StorageOSPersistentVolumeSource? tempStorageos =
      tempStorageosJson != null
          ? StorageOSPersistentVolumeSource.fromJson(tempStorageosJson)
          : null;
  final String? tempVolumeMode = tempVolumeModeJson;
  final VsphereVirtualDiskVolumeSource? tempVsphereVolume =
      tempVsphereVolumeJson != null
          ? VsphereVirtualDiskVolumeSource.fromJson(tempVsphereVolumeJson)
          : null;

  return PersistentVolumeSpec(
    accessModes: tempAccessModes,
    awsElasticBlockStore: tempAwsElasticBlockStore,
    azureDisk: tempAzureDisk,
    azureFile: tempAzureFile,
    capacity: tempCapacity,
    cephfs: tempCephfs,
    cinder: tempCinder,
    claimRef: tempClaimRef,
    csi: tempCsi,
    fc: tempFc,
    flexVolume: tempFlexVolume,
    flocker: tempFlocker,
    gcePersistentDisk: tempGcePersistentDisk,
    glusterfs: tempGlusterfs,
    hostPath: tempHostPath,
    iscsi: tempIscsi,
    local: tempLocal,
    mountOptions: tempMountOptions,
    nfs: tempNfs,
    nodeAffinity: tempNodeAffinity,
    persistentVolumeReclaimPolicy: tempPersistentVolumeReclaimPolicy,
    photonPersistentDisk: tempPhotonPersistentDisk,
    portworxVolume: tempPortworxVolume,
    quobyte: tempQuobyte,
    rbd: tempRbd,
    scaleIO: tempScaleIO,
    storageClassName: tempStorageClassName,
    storageos: tempStorageos,
    volumeMode: tempVolumeMode,
    vsphereVolume: tempVsphereVolume,
  );
}