toJson method
Converts a NodeAffinity instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempPreferredDuringSchedulingIgnoredDuringExecution =
preferredDuringSchedulingIgnoredDuringExecution;
final tempRequiredDuringSchedulingIgnoredDuringExecution =
requiredDuringSchedulingIgnoredDuringExecution;
if (tempPreferredDuringSchedulingIgnoredDuringExecution != null) {
jsonData['preferredDuringSchedulingIgnoredDuringExecution'] =
tempPreferredDuringSchedulingIgnoredDuringExecution
.map((e) => e.toJson())
.toList(growable: false);
}
if (tempRequiredDuringSchedulingIgnoredDuringExecution != null) {
jsonData['requiredDuringSchedulingIgnoredDuringExecution'] =
tempRequiredDuringSchedulingIgnoredDuringExecution.toJson();
}
return jsonData;
}