toJson method
Converts a PodStatus instance to JSON data.
Implementation
Map<String, Object> toJson() {
final jsonData = <String, Object>{};
final tempConditions = conditions;
final tempContainerStatuses = containerStatuses;
final tempEphemeralContainerStatuses = ephemeralContainerStatuses;
final tempHostIP = hostIP;
final tempInitContainerStatuses = initContainerStatuses;
final tempMessage = message;
final tempNominatedNodeName = nominatedNodeName;
final tempPhase = phase;
final tempPodIP = podIP;
final tempPodIPs = podIPs;
final tempQosClass = qosClass;
final tempReason = reason;
final tempResize = resize;
final tempStartTime = startTime;
if (tempConditions != null) {
jsonData['conditions'] =
tempConditions.map((e) => e.toJson()).toList(growable: false);
}
if (tempContainerStatuses != null) {
jsonData['containerStatuses'] =
tempContainerStatuses.map((e) => e.toJson()).toList(growable: false);
}
if (tempEphemeralContainerStatuses != null) {
jsonData['ephemeralContainerStatuses'] = tempEphemeralContainerStatuses
.map((e) => e.toJson())
.toList(growable: false);
}
if (tempHostIP != null) {
jsonData['hostIP'] = tempHostIP;
}
if (tempInitContainerStatuses != null) {
jsonData['initContainerStatuses'] = tempInitContainerStatuses
.map((e) => e.toJson())
.toList(growable: false);
}
if (tempMessage != null) {
jsonData['message'] = tempMessage;
}
if (tempNominatedNodeName != null) {
jsonData['nominatedNodeName'] = tempNominatedNodeName;
}
if (tempPhase != null) {
jsonData['phase'] = tempPhase;
}
if (tempPodIP != null) {
jsonData['podIP'] = tempPodIP;
}
if (tempPodIPs != null) {
jsonData['podIPs'] =
tempPodIPs.map((e) => e.toJson()).toList(growable: false);
}
if (tempQosClass != null) {
jsonData['qosClass'] = tempQosClass;
}
if (tempReason != null) {
jsonData['reason'] = tempReason;
}
if (tempResize != null) {
jsonData['resize'] = tempResize;
}
if (tempStartTime != null) {
jsonData['startTime'] = tempStartTime;
}
return jsonData;
}