Skip to content

Commit 7f44a4a

Browse files
committed
fix
1 parent c1c156d commit 7f44a4a

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

packages/stream_video/lib/open_api/video/coordinator/api_client.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,9 @@ class ApiClient {
620620
return RequestPermissionRequest.fromJson(value);
621621
case 'RequestPermissionResponse':
622622
return RequestPermissionResponse.fromJson(value);
623-
case 'Response':
624-
return Response.fromJson(value);
623+
//MANUAL_EDIT
624+
case 'DurationResponse':
625+
return DurationResponse.fromJson(value);
625626
case 'RingCallRequest':
626627
return RingCallRequest.fromJson(value);
627628
case 'RingCallResponse':

packages/stream_video/lib/open_api/video/coordinator/model/video_event.dart

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)