ContainerState.fromJson constructor
Creates a ContainerState from JSON data.
Implementation
factory ContainerState.fromJson(Map<String, dynamic> json) {
final tempRunningJson = json['running'];
final tempTerminatedJson = json['terminated'];
final tempWaitingJson = json['waiting'];
final ContainerStateRunning? tempRunning = tempRunningJson != null
? ContainerStateRunning.fromJson(tempRunningJson)
: null;
final ContainerStateTerminated? tempTerminated = tempTerminatedJson != null
? ContainerStateTerminated.fromJson(tempTerminatedJson)
: null;
final ContainerStateWaiting? tempWaiting = tempWaitingJson != null
? ContainerStateWaiting.fromJson(tempWaitingJson)
: null;
return ContainerState(
running: tempRunning,
terminated: tempTerminated,
waiting: tempWaiting,
);
}