18
18
from videodb .video import Video
19
19
from videodb .audio import Audio
20
20
from videodb .image import Image
21
+ from videodb .meeting import Meeting
21
22
22
23
from videodb ._upload import (
23
24
upload ,
29
30
class Connection (HttpClient ):
30
31
"""Connection class to interact with the VideoDB"""
31
32
32
- def __init__ (self , api_key : str , base_url : str ) -> "Connection" :
33
+ def __init__ (self , api_key : str , base_url : str , ** kwargs ) -> "Connection" :
33
34
"""Initializes a new instance of the Connection class with specified API credentials.
34
35
35
36
Note: Users should not initialize this class directly.
@@ -44,7 +45,7 @@ def __init__(self, api_key: str, base_url: str) -> "Connection":
44
45
self .api_key = api_key
45
46
self .base_url = base_url
46
47
self .collection_id = "default"
47
- super ().__init__ (api_key = api_key , base_url = base_url , version = __version__ )
48
+ super ().__init__ (api_key = api_key , base_url = base_url , version = __version__ , ** kwargs )
48
49
49
50
def get_collection (self , collection_id : Optional [str ] = "default" ) -> Collection :
50
51
"""Get a collection object by its ID.
@@ -293,3 +294,38 @@ def upload(
293
294
return Audio (self , ** upload_data )
294
295
elif media_id .startswith ("img-" ):
295
296
return Image (self , ** upload_data )
297
+
298
+ def record_meeting (
299
+ self ,
300
+ link : str ,
301
+ bot_name : str ,
302
+ meeting_name : str ,
303
+ callback_url : str ,
304
+ callback_data : dict = {},
305
+ time_zone : str = "UTC" ,
306
+ ) -> Meeting :
307
+ """Record a meeting and upload it to the default collection.
308
+
309
+ :param str link: Meeting link
310
+ :param str bot_name: Name of the recorder bot
311
+ :param str meeting_name: Name of the meeting
312
+ :param str callback_url: URL to receive callback once recording is done
313
+ :param dict callback_data: Data to be sent in the callback (optional)
314
+ :param str time_zone: Time zone for the meeting (default ``UTC``)
315
+ :return: :class:`Meeting <Meeting>` object representing the recording bot
316
+ :rtype: :class:`videodb.meeting.Meeting`
317
+ """
318
+
319
+ response = self .post (
320
+ path = f"{ ApiPath .collection } /default/{ ApiPath .meeting } /{ ApiPath .record } " ,
321
+ data = {
322
+ "link" : link ,
323
+ "bot_name" : bot_name ,
324
+ "meeting_name" : meeting_name ,
325
+ "callback_url" : callback_url ,
326
+ "callback_data" : callback_data ,
327
+ "time_zone" : time_zone ,
328
+ },
329
+ )
330
+ meeting_id = response .get ("meeting_id" )
331
+ return Meeting (self , id = meeting_id , collection_id = "default" , ** response )
0 commit comments