1818from  videodb .video  import  Video 
1919from  videodb .audio  import  Audio 
2020from  videodb .image  import  Image 
21+ from  videodb .meeting  import  Meeting 
2122
2223from  videodb ._upload  import  (
2324    upload ,
2930class  Connection (HttpClient ):
3031    """Connection class to interact with the VideoDB""" 
3132
32-     def  __init__ (self , api_key : str , base_url : str ) ->  "Connection" :
33+     def  __init__ (self , api_key : str , base_url : str ,  ** kwargs ) ->  "Connection" :
3334        """Initializes a new instance of the Connection class with specified API credentials. 
3435
3536        Note: Users should not initialize this class directly. 
@@ -44,7 +45,7 @@ def __init__(self, api_key: str, base_url: str) -> "Connection":
4445        self .api_key  =  api_key 
4546        self .base_url  =  base_url 
4647        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 )
4849
4950    def  get_collection (self , collection_id : Optional [str ] =  "default" ) ->  Collection :
5051        """Get a collection object by its ID. 
@@ -293,3 +294,38 @@ def upload(
293294            return  Audio (self , ** upload_data )
294295        elif  media_id .startswith ("img-" ):
295296            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 } { 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