NodeSelectorRequirement.fromJson constructor

NodeSelectorRequirement.fromJson(
  1. Map<String, dynamic> json
)

Creates a NodeSelectorRequirement from JSON data.

Implementation

factory NodeSelectorRequirement.fromJson(Map<String, dynamic> json) {
  final tempKeyJson = json['key'];
  final tempOperatorJson = json['operator'];
  final tempValuesJson = json['values'];

  final String tempKey = tempKeyJson;
  final String tempOperator = tempOperatorJson;
  final List<String>? tempValues =
      tempValuesJson != null ? List<String>.from(tempValuesJson) : null;

  return NodeSelectorRequirement(
    key: tempKey,
    operator: tempOperator,
    values: tempValues,
  );
}