toJson method

Map<String, Object> toJson()

Converts a FlexVolumeSource instance to JSON data.

Implementation

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

  final tempDriver = driver;
  final tempFsType = fsType;
  final tempOptions = options;
  final tempReadOnly = readOnly;
  final tempSecretRef = secretRef;

  jsonData['driver'] = tempDriver;

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

  if (tempOptions != null) {
    jsonData['options'] = tempOptions;
  }

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

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

  return jsonData;
}