CSIPersistentVolumeSource.fromJson constructor

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

Creates a CSIPersistentVolumeSource from JSON data.

Implementation

factory CSIPersistentVolumeSource.fromJson(Map<String, dynamic> json) {
  final tempControllerExpandSecretRefJson = json['controllerExpandSecretRef'];
  final tempControllerPublishSecretRefJson =
      json['controllerPublishSecretRef'];
  final tempDriverJson = json['driver'];
  final tempFsTypeJson = json['fsType'];
  final tempNodeExpandSecretRefJson = json['nodeExpandSecretRef'];
  final tempNodePublishSecretRefJson = json['nodePublishSecretRef'];
  final tempNodeStageSecretRefJson = json['nodeStageSecretRef'];
  final tempReadOnlyJson = json['readOnly'];
  final tempVolumeAttributesJson = json['volumeAttributes'];
  final tempVolumeHandleJson = json['volumeHandle'];

  final SecretReference? tempControllerExpandSecretRef =
      tempControllerExpandSecretRefJson != null
          ? SecretReference.fromJson(tempControllerExpandSecretRefJson)
          : null;
  final SecretReference? tempControllerPublishSecretRef =
      tempControllerPublishSecretRefJson != null
          ? SecretReference.fromJson(tempControllerPublishSecretRefJson)
          : null;
  final String tempDriver = tempDriverJson;
  final String? tempFsType = tempFsTypeJson;
  final SecretReference? tempNodeExpandSecretRef =
      tempNodeExpandSecretRefJson != null
          ? SecretReference.fromJson(tempNodeExpandSecretRefJson)
          : null;
  final SecretReference? tempNodePublishSecretRef =
      tempNodePublishSecretRefJson != null
          ? SecretReference.fromJson(tempNodePublishSecretRefJson)
          : null;
  final SecretReference? tempNodeStageSecretRef =
      tempNodeStageSecretRefJson != null
          ? SecretReference.fromJson(tempNodeStageSecretRefJson)
          : null;
  final bool? tempReadOnly = tempReadOnlyJson;

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

  final String tempVolumeHandle = tempVolumeHandleJson;

  return CSIPersistentVolumeSource(
    controllerExpandSecretRef: tempControllerExpandSecretRef,
    controllerPublishSecretRef: tempControllerPublishSecretRef,
    driver: tempDriver,
    fsType: tempFsType,
    nodeExpandSecretRef: tempNodeExpandSecretRef,
    nodePublishSecretRef: tempNodePublishSecretRef,
    nodeStageSecretRef: tempNodeStageSecretRef,
    readOnly: tempReadOnly,
    volumeAttributes: tempVolumeAttributes,
    volumeHandle: tempVolumeHandle,
  );
}