toJson method

Map<String, Object> toJson()

Converts a VolumeAttachmentSource instance to JSON data.

Implementation

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

  final tempInlineVolumeSpec = inlineVolumeSpec;
  final tempPersistentVolumeName = persistentVolumeName;

  if (tempInlineVolumeSpec != null) {
    jsonData['inlineVolumeSpec'] = tempInlineVolumeSpec.toJson();
  }

  if (tempPersistentVolumeName != null) {
    jsonData['persistentVolumeName'] = tempPersistentVolumeName;
  }

  return jsonData;
}