Skip to content

Commit 6c43141

Browse files
api: Add routes to fetch zoom and bigBlueButton call url
1 parent 358f94f commit 6c43141

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

lib/api/model/model.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,24 @@ class RealmAvailableVideoChatProviders {
7676
Map<String, dynamic> toJson() => _$RealmAvailableVideoChatProvidersToJson(this);
7777
}
7878

79+
@JsonSerializable(fieldRename: FieldRename.snake)
80+
class VideoCallResponse {
81+
final String msg;
82+
final String result;
83+
final String url;
84+
85+
VideoCallResponse({
86+
required this.msg,
87+
required this.result,
88+
required this.url,
89+
});
90+
91+
factory VideoCallResponse.fromJson(Map<String, dynamic> json) =>
92+
_$VideoCallResponseFromJson(json);
93+
94+
Map<String, dynamic> toJson() => _$VideoCallResponseToJson(this);
95+
}
96+
7997
/// As in [InitialSnapshot.customProfileFields].
8098
///
8199
/// For docs, search for "custom_profile_fields:"

lib/api/model/model.g.dart

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/api/route/video_call.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import '../core.dart';
2+
import '../model/model.dart';
3+
4+
/// Creates a Zoom video/audio call
5+
///
6+
/// POST /api/v1/calls/zoom/create
7+
Future<VideoCallResponse> createZoomCall(ApiConnection connection, {
8+
required bool isVideoCall,
9+
}) async {
10+
return connection.post('createZoomCall', VideoCallResponse.fromJson,
11+
'/calls/zoom/create', {'is_video_call': isVideoCall});
12+
}
13+
14+
/// Creates a BigBlueButton meeting
15+
///
16+
/// GET /api/v1/calls/bigbluebutton/create
17+
Future<VideoCallResponse> createBigBlueButtonCall(ApiConnection connection, {
18+
required String meetingName,
19+
required bool voiceOnly,
20+
}) async {
21+
return connection.get('createBigBlueButtonCall', VideoCallResponse.fromJson,
22+
'/calls/bigbluebutton/create', {'meeting_name': meetingName, 'voice_only': voiceOnly});
23+
}

0 commit comments

Comments
 (0)