toJson method
Converts a SecretVolumeSource instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempDefaultMode = defaultMode;
final tempItems = items;
final tempOptional = optional;
final tempSecretName = secretName;
if (tempDefaultMode != null) {
jsonData['defaultMode'] = tempDefaultMode;
}
if (tempItems != null) {
jsonData['items'] =
tempItems.map((e) => e.toJson()).toList(growable: false);
}
if (tempOptional != null) {
jsonData['optional'] = tempOptional;
}
if (tempSecretName != null) {
jsonData['secretName'] = tempSecretName;
}
return jsonData;
}