From 53a866e79adb55f060d3a4d286afd55797d78376 Mon Sep 17 00:00:00 2001 From: sharinetmc <128429303+sharinetmc@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:59:37 -1000 Subject: [PATCH] add method and test webinar report (#1213) * add method and test webinar report * typo * typo * typo * clean up * undo * typo * fix test * delete commented out stuff * remove default param value * ruff format --- parsons/zoom/zoom.py | 17 +++++++++++++++++ test/test_zoom.py | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/parsons/zoom/zoom.py b/parsons/zoom/zoom.py index 7c71bbe32..59ee734a7 100644 --- a/parsons/zoom/zoom.py +++ b/parsons/zoom/zoom.py @@ -255,6 +255,23 @@ def get_user_webinars(self, user_id): logger.info(f"Retrieved {tbl.num_rows} webinars.") return tbl + def get_past_webinar_report(self, webinar_id): + """ + Get past meeting participants + + `Args:` + webinar_id: str + The webinar id + `Returns:` + Parsons Table + See :ref:`parsons-table` for output options. + """ + + dic = self._get_request(endpoint=f"report/webinars/{webinar_id}", data_key=None) + if dic: + logger.info(f"Retrieved webinar report for webinar: {webinar_id}.") + return dic + def get_past_webinar_participants(self, webinar_id): """ Get past meeting participants diff --git a/test/test_zoom.py b/test/test_zoom.py index 2569e24e8..5aa178684 100644 --- a/test/test_zoom.py +++ b/test/test_zoom.py @@ -312,6 +312,29 @@ def test_get_past_webinar_participants(self, m): m.get(ZOOM_URI + "report/webinars/123/participants", json=participants) assert_matching_tables(self.zoom.get_past_webinar_participants(123), tbl) + @requests_mock.Mocker() + def test_get_past_webinar_report(self, m): + report = { + "custom_keys": [{"key": "Host Nation", "value": "US"}], + "dept": "HR", + "duration": 2, + "end_time": "2022-03-15T07:42:22Z", + "id": 345678902224, + "participants_count": 4, + "start_time": "2022-03-15T07:40:46Z", + "topic": "My Meeting", + "total_minutes": 3, + "tracking_fields": [{"field": "Host Nation", "value": "US"}], + "type": 4, + "user_email": "jchill@example.com", + "user_name": "Jill Chill", + "uuid": "4444AAAiAAAAAiAiAiiAii==", + } + + m.post(ZOOM_AUTH_CALLBACK, json={"access_token": "fakeAccessToken"}) + m.get(ZOOM_URI + "report/webinars/123", json=report) + assert_matching_tables(self.zoom.get_past_webinar_report(123), report) + @requests_mock.Mocker() def test_get_webinar_registrants(self, m): registrants = {