toJson method

Map<String, Object> toJson()

Converts a RBDVolumeSource instance to JSON data.

Implementation

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

  final tempFsType = fsType;
  final tempImage = image;
  final tempKeyring = keyring;
  final tempMonitors = monitors;
  final tempPool = pool;
  final tempReadOnly = readOnly;
  final tempSecretRef = secretRef;
  final tempUser = user;

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

  jsonData['image'] = tempImage;

  if (tempKeyring != null) {
    jsonData['keyring'] = tempKeyring;
  }

  jsonData['monitors'] = tempMonitors;

  if (tempPool != null) {
    jsonData['pool'] = tempPool;
  }

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

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

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

  return jsonData;
}