LabelSelector.fromJson constructor
Creates a LabelSelector from JSON data.
Implementation
factory LabelSelector.fromJson(Map<String, dynamic> json) {
final tempMatchExpressionsJson = json['matchExpressions'];
final tempMatchLabelsJson = json['matchLabels'];
final List<LabelSelectorRequirement>? tempMatchExpressions =
tempMatchExpressionsJson != null
? List<dynamic>.from(tempMatchExpressionsJson)
.map(
(e) => LabelSelectorRequirement.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final Map<String, String>? tempMatchLabels = tempMatchLabelsJson != null
? Map<String, String>.from(tempMatchLabelsJson)
: null;
return LabelSelector(
matchExpressions: tempMatchExpressions,
matchLabels: tempMatchLabels,
);
}