toJson method

Map<String, Object> toJson()

Converts a StorageOSPersistentVolumeSource instance to JSON data.

Implementation

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

  final tempFsType = fsType;
  final tempReadOnly = readOnly;
  final tempSecretRef = secretRef;
  final tempVolumeName = volumeName;
  final tempVolumeNamespace = volumeNamespace;

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

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

  if (tempSecretRef != null) {
    jsonData['secretRef'] = tempSecretRef.toJson();
  }

  if (tempVolumeName != null) {
    jsonData['volumeName'] = tempVolumeName;
  }

  if (tempVolumeNamespace != null) {
    jsonData['volumeNamespace'] = tempVolumeNamespace;
  }

  return jsonData;
}