36 lines
963 B
Dart
36 lines
963 B
Dart
class TerminalSnapshot {
|
|
const TerminalSnapshot({
|
|
required this.sessionId,
|
|
required this.projectId,
|
|
required this.sessionName,
|
|
required this.bufferText,
|
|
required this.updatedAtUtc,
|
|
});
|
|
|
|
final String sessionId;
|
|
final String? projectId;
|
|
final String sessionName;
|
|
final String bufferText;
|
|
final String updatedAtUtc;
|
|
|
|
factory TerminalSnapshot.fromJson(Map<String, dynamic> json) {
|
|
return TerminalSnapshot(
|
|
sessionId: json['sessionId'] as String,
|
|
projectId: json['projectId'] as String?,
|
|
sessionName: (json['sessionName'] as String?) ?? '',
|
|
bufferText: (json['bufferText'] as String?) ?? '',
|
|
updatedAtUtc: (json['updatedAtUtc'] as String?) ?? '',
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toJson() {
|
|
return <String, dynamic>{
|
|
'sessionId': sessionId,
|
|
'projectId': projectId,
|
|
'sessionName': sessionName,
|
|
'bufferText': bufferText,
|
|
'updatedAtUtc': updatedAtUtc,
|
|
};
|
|
}
|
|
}
|