CockpitRemoteRecordingResponse.fromJson constructor
Decodes a CockpitRemoteRecordingResponse from a JSON object.
Implementation
factory CockpitRemoteRecordingResponse.fromJson(Map<String, Object?> json) {
final resultJson = json['result'] as Map<Object?, Object?>;
final downloadsJson =
json['artifactDownloads'] as List<Object?>? ?? const <Object?>[];
return CockpitRemoteRecordingResponse(
result: CockpitRecordingResult.fromJson(
Map<String, Object?>.from(resultJson),
),
artifactDownloads: downloadsJson
.cast<Map<Object?, Object?>>()
.map(
(download) => CockpitRemoteArtifactDownload.fromJson(
Map<String, Object?>.from(download),
),
)
.toList(growable: false),
);
}