toJson method

Map<String, Object> toJson()

Converts a CSIPersistentVolumeSource instance to JSON data.

Implementation

Map<String, Object> toJson() {
  final jsonData = <String, Object>{};

  final tempControllerExpandSecretRef = controllerExpandSecretRef;
  final tempControllerPublishSecretRef = controllerPublishSecretRef;
  final tempDriver = driver;
  final tempFsType = fsType;
  final tempNodeExpandSecretRef = nodeExpandSecretRef;
  final tempNodePublishSecretRef = nodePublishSecretRef;
  final tempNodeStageSecretRef = nodeStageSecretRef;
  final tempReadOnly = readOnly;
  final tempVolumeAttributes = volumeAttributes;
  final tempVolumeHandle = volumeHandle;

  if (tempControllerExpandSecretRef != null) {
    jsonData['controllerExpandSecretRef'] =
        tempControllerExpandSecretRef.toJson();
  }

  if (tempControllerPublishSecretRef != null) {
    jsonData['controllerPublishSecretRef'] =
        tempControllerPublishSecretRef.toJson();
  }

  jsonData['driver'] = tempDriver;

  if (tempFsType != null) {
    jsonData['fsType'] = tempFsType;
  }

  if (tempNodeExpandSecretRef != null) {
    jsonData['nodeExpandSecretRef'] = tempNodeExpandSecretRef.toJson();
  }

  if (tempNodePublishSecretRef != null) {
    jsonData['nodePublishSecretRef'] = tempNodePublishSecretRef.toJson();
  }

  if (tempNodeStageSecretRef != null) {
    jsonData['nodeStageSecretRef'] = tempNodeStageSecretRef.toJson();
  }

  if (tempReadOnly != null) {
    jsonData['readOnly'] = tempReadOnly;
  }

  if (tempVolumeAttributes != null) {
    jsonData['volumeAttributes'] = tempVolumeAttributes;
  }

  jsonData['volumeHandle'] = tempVolumeHandle;

  return jsonData;
}