NodeSpec.fromJson constructor
Creates a NodeSpec from JSON data.
Implementation
factory NodeSpec.fromJson(Map<String, dynamic> json) {
final tempConfigSourceJson = json['configSource'];
final tempExternalIDJson = json['externalID'];
final tempPodCIDRJson = json['podCIDR'];
final tempPodCIDRsJson = json['podCIDRs'];
final tempProviderIDJson = json['providerID'];
final tempTaintsJson = json['taints'];
final tempUnschedulableJson = json['unschedulable'];
final NodeConfigSource? tempConfigSource = tempConfigSourceJson != null
? NodeConfigSource.fromJson(tempConfigSourceJson)
: null;
final String? tempExternalID = tempExternalIDJson;
final String? tempPodCIDR = tempPodCIDRJson;
final List<String>? tempPodCIDRs =
tempPodCIDRsJson != null ? List<String>.from(tempPodCIDRsJson) : null;
final String? tempProviderID = tempProviderIDJson;
final List<Taint>? tempTaints = tempTaintsJson != null
? List<dynamic>.from(tempTaintsJson)
.map(
(e) => Taint.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final bool? tempUnschedulable = tempUnschedulableJson;
return NodeSpec(
configSource: tempConfigSource,
externalID: tempExternalID,
podCIDR: tempPodCIDR,
podCIDRs: tempPodCIDRs,
providerID: tempProviderID,
taints: tempTaints,
unschedulable: tempUnschedulable,
);
}