ISCSIVolumeSource.fromJson constructor

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

Creates a ISCSIVolumeSource from JSON data.

Implementation

factory ISCSIVolumeSource.fromJson(Map<String, dynamic> json) {
  final tempChapAuthDiscoveryJson = json['chapAuthDiscovery'];
  final tempChapAuthSessionJson = json['chapAuthSession'];
  final tempFsTypeJson = json['fsType'];
  final tempInitiatorNameJson = json['initiatorName'];
  final tempIqnJson = json['iqn'];
  final tempIscsiInterfaceJson = json['iscsiInterface'];
  final tempLunJson = json['lun'];
  final tempPortalsJson = json['portals'];
  final tempReadOnlyJson = json['readOnly'];
  final tempSecretRefJson = json['secretRef'];
  final tempTargetPortalJson = json['targetPortal'];

  final bool? tempChapAuthDiscovery = tempChapAuthDiscoveryJson;
  final bool? tempChapAuthSession = tempChapAuthSessionJson;
  final String? tempFsType = tempFsTypeJson;
  final String? tempInitiatorName = tempInitiatorNameJson;
  final String tempIqn = tempIqnJson;
  final String? tempIscsiInterface = tempIscsiInterfaceJson;
  final int tempLun = tempLunJson;
  final List<String>? tempPortals =
      tempPortalsJson != null ? List<String>.from(tempPortalsJson) : null;
  final bool? tempReadOnly = tempReadOnlyJson;
  final LocalObjectReference? tempSecretRef = tempSecretRefJson != null
      ? LocalObjectReference.fromJson(tempSecretRefJson)
      : null;
  final String tempTargetPortal = tempTargetPortalJson;

  return ISCSIVolumeSource(
    chapAuthDiscovery: tempChapAuthDiscovery,
    chapAuthSession: tempChapAuthSession,
    fsType: tempFsType,
    initiatorName: tempInitiatorName,
    iqn: tempIqn,
    iscsiInterface: tempIscsiInterface,
    lun: tempLun,
    portals: tempPortals,
    readOnly: tempReadOnly,
    secretRef: tempSecretRef,
    targetPortal: tempTargetPortal,
  );
}