NodeAffinity.fromJson constructor
Creates a NodeAffinity from JSON data.
Implementation
factory NodeAffinity.fromJson(Map<String, dynamic> json) {
final tempPreferredDuringSchedulingIgnoredDuringExecutionJson =
json['preferredDuringSchedulingIgnoredDuringExecution'];
final tempRequiredDuringSchedulingIgnoredDuringExecutionJson =
json['requiredDuringSchedulingIgnoredDuringExecution'];
final List<PreferredSchedulingTerm>?
tempPreferredDuringSchedulingIgnoredDuringExecution =
tempPreferredDuringSchedulingIgnoredDuringExecutionJson != null
? List<dynamic>.from(
tempPreferredDuringSchedulingIgnoredDuringExecutionJson)
.map(
(e) => PreferredSchedulingTerm.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final NodeSelector? tempRequiredDuringSchedulingIgnoredDuringExecution =
tempRequiredDuringSchedulingIgnoredDuringExecutionJson != null
? NodeSelector.fromJson(
tempRequiredDuringSchedulingIgnoredDuringExecutionJson)
: null;
return NodeAffinity(
preferredDuringSchedulingIgnoredDuringExecution:
tempPreferredDuringSchedulingIgnoredDuringExecution,
requiredDuringSchedulingIgnoredDuringExecution:
tempRequiredDuringSchedulingIgnoredDuringExecution,
);
}