AllocationResult.fromJson constructor
Creates a AllocationResult from JSON data.
Implementation
factory AllocationResult.fromJson(Map<String, dynamic> json) {
final tempAvailableOnNodesJson = json['availableOnNodes'];
final tempResourceHandlesJson = json['resourceHandles'];
final tempShareableJson = json['shareable'];
final NodeSelector? tempAvailableOnNodes = tempAvailableOnNodesJson != null
? NodeSelector.fromJson(tempAvailableOnNodesJson)
: null;
final List<ResourceHandle>? tempResourceHandles =
tempResourceHandlesJson != null
? List<dynamic>.from(tempResourceHandlesJson)
.map(
(e) => ResourceHandle.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final bool? tempShareable = tempShareableJson;
return AllocationResult(
availableOnNodes: tempAvailableOnNodes,
resourceHandles: tempResourceHandles,
shareable: tempShareable,
);
}