ContainerStateTerminated.fromJson constructor
Creates a ContainerStateTerminated from JSON data.
Implementation
factory ContainerStateTerminated.fromJson(Map<String, dynamic> json) {
final tempContainerIDJson = json['containerID'];
final tempExitCodeJson = json['exitCode'];
final tempFinishedAtJson = json['finishedAt'];
final tempMessageJson = json['message'];
final tempReasonJson = json['reason'];
final tempSignalJson = json['signal'];
final tempStartedAtJson = json['startedAt'];
final String? tempContainerID = tempContainerIDJson;
final int tempExitCode = tempExitCodeJson;
final DateTime? tempFinishedAt = tempFinishedAtJson != null
? DateTime.tryParse(tempFinishedAtJson)
: null;
final String? tempMessage = tempMessageJson;
final String? tempReason = tempReasonJson;
final int? tempSignal = tempSignalJson;
final DateTime? tempStartedAt =
tempStartedAtJson != null ? DateTime.tryParse(tempStartedAtJson) : null;
return ContainerStateTerminated(
containerID: tempContainerID,
exitCode: tempExitCode,
finishedAt: tempFinishedAt,
message: tempMessage,
reason: tempReason,
signal: tempSignal,
startedAt: tempStartedAt,
);
}