27 lines
663 B
Dart
27 lines
663 B
Dart
class ContextModel {
|
|
ContextModel({
|
|
required this.id,
|
|
required this.name,
|
|
required this.kind,
|
|
this.retentionDays,
|
|
this.screenshotBlocked = false,
|
|
});
|
|
|
|
final String id;
|
|
final String name;
|
|
final String kind;
|
|
final int? retentionDays;
|
|
final bool screenshotBlocked;
|
|
|
|
factory ContextModel.fromJson(Map<String, dynamic> j) {
|
|
final policy = j['policy'] as Map<String, dynamic>?;
|
|
return ContextModel(
|
|
id: j['id'] as String,
|
|
name: j['name'] as String,
|
|
kind: j['kind'] as String,
|
|
retentionDays: policy?['retentionDays'] as int?,
|
|
screenshotBlocked: policy?['screenshotBlocked'] == true,
|
|
);
|
|
}
|
|
}
|