NodeCondition.fromJson constructor
Creates a NodeCondition from JSON data.
Implementation
factory NodeCondition.fromJson(Map<String, dynamic> json) {
final tempLastHeartbeatTimeJson = json['lastHeartbeatTime'];
final tempLastTransitionTimeJson = json['lastTransitionTime'];
final tempMessageJson = json['message'];
final tempReasonJson = json['reason'];
final tempStatusJson = json['status'];
final tempTypeJson = json['type'];
final DateTime? tempLastHeartbeatTime = tempLastHeartbeatTimeJson != null
? DateTime.tryParse(tempLastHeartbeatTimeJson)
: null;
final DateTime? tempLastTransitionTime = tempLastTransitionTimeJson != null
? DateTime.tryParse(tempLastTransitionTimeJson)
: null;
final String? tempMessage = tempMessageJson;
final String? tempReason = tempReasonJson;
final String tempStatus = tempStatusJson;
final String tempType = tempTypeJson;
return NodeCondition(
lastHeartbeatTime: tempLastHeartbeatTime,
lastTransitionTime: tempLastTransitionTime,
message: tempMessage,
reason: tempReason,
status: tempStatus,
type: tempType,
);
}