@@ -603,9 +603,10 @@ class VideoEvent {
603603 url: mapValueOfType <String >(json, r'url' )! ,
604604 users: UserResponse .mapFromJson (json[r'users' ]),
605605 hlsPlaylistUrl: mapValueOfType <String >(json, r'hls_playlist_url' )! ,
606+ //MANUAL_EDIT mapCast
606607 capabilitiesByRole: json[r'capabilities_by_role' ] == null
607608 ? const {}
608- : mapCastOfType < String , List > (json, r 'capabilities_by_role' ),
609+ : capabilitiesFromJson (json[ 'capabilities_by_role' ] ),
609610 notifyUser: mapValueOfType <bool >(json, r'notify_user' )! ,
610611 userId: mapValueOfType <String >(json, r'user_id' )! ,
611612 message: mapValueOfType <String >(json, r'message' )! ,
@@ -667,6 +668,24 @@ class VideoEvent {
667668 return null ;
668669 }
669670
671+ // MANUAL_EDIT: capabilitiesFromJson
672+ static Map <String , List <String >> capabilitiesFromJson (
673+ dynamic json, {
674+ bool growable = false ,
675+ }) {
676+ final map = < String , List <String >> {};
677+ if (json is Map && json.isNotEmpty) {
678+ // ignore: parameter_assignments
679+ json = json.cast <String , dynamic >();
680+ for (final entry in json.entries) {
681+ if (entry.value is List ) {
682+ map[entry.key] = (entry.value as List ).cast <String >();
683+ }
684+ }
685+ }
686+ return growable ? map : Map .unmodifiable (map);
687+ }
688+
670689 static List <VideoEvent > listFromJson (
671690 dynamic json, {
672691 bool growable = false ,
0 commit comments