toJson method

Map<String, Object> toJson()

Converts a CephFSVolumeSource instance to JSON data.

Implementation

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

  final tempMonitors = monitors;
  final tempPath = path;
  final tempReadOnly = readOnly;
  final tempSecretFile = secretFile;
  final tempSecretRef = secretRef;
  final tempUser = user;

  jsonData['monitors'] = tempMonitors;

  if (tempPath != null) {
    jsonData['path'] = tempPath;
  }

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

  if (tempSecretFile != null) {
    jsonData['secretFile'] = tempSecretFile;
  }

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

  if (tempUser != null) {
    jsonData['user'] = tempUser;
  }

  return jsonData;
}