Affinity.fromJson constructor
Creates a Affinity from JSON data.
Implementation
factory Affinity.fromJson(Map<String, dynamic> json) {
final tempNodeAffinityJson = json['nodeAffinity'];
final tempPodAffinityJson = json['podAffinity'];
final tempPodAntiAffinityJson = json['podAntiAffinity'];
final NodeAffinity? tempNodeAffinity = tempNodeAffinityJson != null
? NodeAffinity.fromJson(tempNodeAffinityJson)
: null;
final PodAffinity? tempPodAffinity = tempPodAffinityJson != null
? PodAffinity.fromJson(tempPodAffinityJson)
: null;
final PodAntiAffinity? tempPodAntiAffinity = tempPodAntiAffinityJson != null
? PodAntiAffinity.fromJson(tempPodAntiAffinityJson)
: null;
return Affinity(
nodeAffinity: tempNodeAffinity,
podAffinity: tempPodAffinity,
podAntiAffinity: tempPodAntiAffinity,
);
}