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 j) { final policy = j['policy'] as Map?; 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, ); } }