NodeConfigStatus.fromJson constructor

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

Creates a NodeConfigStatus from JSON data.

Implementation

factory NodeConfigStatus.fromJson(Map<String, dynamic> json) {
  final tempActiveJson = json['active'];
  final tempAssignedJson = json['assigned'];
  final tempErrorJson = json['error'];
  final tempLastKnownGoodJson = json['lastKnownGood'];

  final NodeConfigSource? tempActive = tempActiveJson != null
      ? NodeConfigSource.fromJson(tempActiveJson)
      : null;
  final NodeConfigSource? tempAssigned = tempAssignedJson != null
      ? NodeConfigSource.fromJson(tempAssignedJson)
      : null;
  final String? tempError = tempErrorJson;
  final NodeConfigSource? tempLastKnownGood = tempLastKnownGoodJson != null
      ? NodeConfigSource.fromJson(tempLastKnownGoodJson)
      : null;

  return NodeConfigStatus(
    active: tempActive,
    assigned: tempAssigned,
    error: tempError,
    lastKnownGood: tempLastKnownGood,
  );
}