Skip to content

Commit 0f03164

Browse files
committed
Add get_meeting in coll and conn, add bot_image_url param in record meeting, fix repr
1 parent bd1ae9a commit 0f03164

File tree

3 files changed

+40
-8
lines changed

3 files changed

+40
-8
lines changed

videodb/client.py

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def __init__(self, api_key: str, base_url: str, **kwargs) -> "Connection":
4545
self.api_key = api_key
4646
self.base_url = base_url
4747
self.collection_id = "default"
48-
super().__init__(api_key=api_key, base_url=base_url, version=__version__, **kwargs)
48+
super().__init__(
49+
api_key=api_key, base_url=base_url, version=__version__, **kwargs
50+
)
4951

5052
def get_collection(self, collection_id: Optional[str] = "default") -> Collection:
5153
"""Get a collection object by its ID.
@@ -272,8 +274,8 @@ def upload(
272274
:param str name: Name of the file (optional)
273275
:param str description: Description of the file (optional)
274276
:param str callback_url: URL to receive the callback (optional)
275-
:param str file_path: Path to the file to upload (optional)
276-
:param str url: URL of the file to upload (optional)
277+
:param str file_path: Path to the file to upload (optional)
278+
:param str url: URL of the file to upload (optional)
277279
:return: :class:`Video <Video>`, or :class:`Audio <Audio>`, or :class:`Image <Image>` object
278280
:rtype: Union[ :class:`videodb.video.Video`, :class:`videodb.audio.Audio`, :class:`videodb.image.Image`]
279281
"""
@@ -298,16 +300,18 @@ def upload(
298300
def record_meeting(
299301
self,
300302
link: str,
301-
bot_name: str,
302-
meeting_name: str,
303-
callback_url: str,
303+
bot_name: str = None,
304+
bot_image_url: str = None,
305+
meeting_name: str = None,
306+
callback_url: str = None,
304307
callback_data: dict = {},
305308
time_zone: str = "UTC",
306309
) -> Meeting:
307310
"""Record a meeting and upload it to the default collection.
308311
309312
:param str link: Meeting link
310313
:param str bot_name: Name of the recorder bot
314+
:param str bot_image_url: URL of the recorder bot image
311315
:param str meeting_name: Name of the meeting
312316
:param str callback_url: URL to receive callback once recording is done
313317
:param dict callback_data: Data to be sent in the callback (optional)
@@ -321,6 +325,7 @@ def record_meeting(
321325
data={
322326
"link": link,
323327
"bot_name": bot_name,
328+
"bot_image_url": bot_image_url,
324329
"meeting_name": meeting_name,
325330
"callback_url": callback_url,
326331
"callback_data": callback_data,
@@ -329,3 +334,14 @@ def record_meeting(
329334
)
330335
meeting_id = response.get("meeting_id")
331336
return Meeting(self, id=meeting_id, collection_id="default", **response)
337+
338+
def get_meeting(self, meeting_id: str) -> Meeting:
339+
"""Get a meeting by its ID.
340+
341+
:param str meeting_id: ID of the meeting
342+
:return: :class:`Meeting <Meeting>` object
343+
:rtype: :class:`videodb.meeting.Meeting`
344+
"""
345+
meeting = Meeting(self, id=meeting_id, collection_id="default")
346+
meeting.refresh()
347+
return meeting

videodb/collection.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ def record_meeting(
517517
self,
518518
link: str,
519519
bot_name: str = None,
520+
bot_image_url: str = None,
520521
meeting_name: str = None,
521522
callback_url: str = None,
522523
callback_data: dict = {},
@@ -526,6 +527,7 @@ def record_meeting(
526527
527528
:param str link: Meeting link
528529
:param str bot_name: Name of the recorder bot
530+
:param str bot_image_url: URL of the recorder bot image
529531
:param str meeting_name: Name of the meeting
530532
:param str callback_url: URL to receive callback once recording is done
531533
:param dict callback_data: Data to be sent in the callback (optional)
@@ -539,11 +541,25 @@ def record_meeting(
539541
data={
540542
"link": link,
541543
"bot_name": bot_name,
544+
"bot_image_url": bot_image_url,
542545
"meeting_name": meeting_name,
543546
"callback_url": callback_url,
544547
"callback_data": callback_data,
545548
"time_zone": time_zone,
546549
},
547550
)
548551
meeting_id = response.get("meeting_id")
549-
return Meeting(self._connection, id=meeting_id, collection_id=self.id, **response)
552+
return Meeting(
553+
self._connection, id=meeting_id, collection_id=self.id, **response
554+
)
555+
556+
def get_meeting(self, meeting_id: str) -> Meeting:
557+
"""Get a meeting by its ID.
558+
559+
:param str meeting_id: ID of the meeting
560+
:return: :class:`Meeting <Meeting>` object
561+
:rtype: :class:`videodb.meeting.Meeting`
562+
"""
563+
meeting = Meeting(self._connection, id=meeting_id, collection_id=self.id)
564+
meeting.refresh()
565+
return meeting

videodb/meeting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, _connection, id: str, collection_id: str, **kwargs) -> None:
2626
self._update_attributes(kwargs)
2727

2828
def __repr__(self) -> str:
29-
return f"Meeting(id={self.id}, collection_id={self.collection_id}, name={self.name}, status={self.status}, bot_name={self.bot_name})"
29+
return f"Meeting(id={self.id}, collection_id={self.collection_id}, name={self.name}, status={self.status}, bot_name={self.bot_name}, meeting_url={self.meeting_url})"
3030

3131
def _update_attributes(self, data: dict) -> None:
3232
"""Update instance attributes from API response data.

0 commit comments

Comments
 (0)