zoom: Create shared TypedDict for zoom call payloads.

Prep for adding a server to server oauth zoom integration.
This commit is contained in:
Lauryn Menard
2025-01-10 17:28:18 +01:00
committed by Tim Abbott
parent cb68d11ee3
commit 901141e297

View File

@@ -108,6 +108,16 @@ class StateDict(TypedDict):
sid: str sid: str
class ZoomVideoSettings(TypedDict):
host_video: bool
participant_video: bool
class ZoomPayload(TypedDict):
settings: ZoomVideoSettings
default_password: bool
@never_cache @never_cache
@typed_endpoint @typed_endpoint
def complete_zoom_user( def complete_zoom_user(
@@ -166,19 +176,17 @@ def make_zoom_video_call(
# why when creating a meeting, configure the video on/off default # why when creating a meeting, configure the video on/off default
# according to the desired call type. Each Zoom user can still have # according to the desired call type. Each Zoom user can still have
# their own personal setting to not start video by default. # their own personal setting to not start video by default.
payload = { video_settings = ZoomVideoSettings(host_video=is_video_call, participant_video=is_video_call)
"settings": { payload = ZoomPayload(
"host_video": is_video_call, settings=video_settings,
"participant_video": is_video_call,
},
# Generate a default password depending on the user settings. This will # Generate a default password depending on the user settings. This will
# result in the password being appended to the returned Join URL. # result in the password being appended to the returned Join URL.
# #
# If we don't request a password to be set, the waiting room will be # If we don't request a password to be set, the waiting room will be
# forcibly enabled in Zoom organizations that require some kind of # forcibly enabled in Zoom organizations that require some kind of
# authentication for all meetings. # authentication for all meetings.
"default_password": True, default_password=True,
} )
try: try:
res = oauth.post("https://api.zoom.us/v2/users/me/meetings", json=payload) res = oauth.post("https://api.zoom.us/v2/users/me/meetings", json=payload)